rust/compiler/rustc_ast_lowering/src
bors 2b399b5275 Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors
never_patterns: Parse match arms with no body

Never patterns are meant to signal unreachable cases, and thus don't take bodies:
```rust
let ptr: *const Option<!> = ...;
match *ptr {
    None => { foo(); }
    Some(!),
}
```
This PR makes rustc accept the above, and enforces that an arm has a body xor is a never pattern. This affects parsing of match arms even with the feature off, so this is delicate. (Plus this is my first non-trivial change to the parser).

~~The last commit is optional; it introduces a bit of churn to allow the new suggestions to be machine-applicable. There may be a better solution? I'm not sure.~~ EDIT: I removed that commit

r? `@compiler-errors`
2023-12-08 17:08:52 +00:00
..
asm.rs rustc: Harmonize DefKind and DefPathData 2023-12-03 16:24:56 +03:00
block.rs rustc_ast_lowering: remove ref patterns 2022-11-22 18:49:29 +00:00
errors.rs Disallow arm bodies on never patterns 2023-12-03 12:25:46 +01:00
expr.rs Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors 2023-12-08 17:08:52 +00:00
format.rs Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug. 2023-12-02 09:01:19 +11:00
index.rs Reduce exposure of some things. 2023-11-28 14:32:40 +11:00
item.rs Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errors 2023-12-06 16:00:24 +00:00
lib.rs Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errors 2023-12-06 16:00:24 +00:00
lifetime_collector.rs Reduce exposure of some things. 2023-11-28 14:32:40 +11:00
pat.rs Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errors 2023-11-29 12:34:47 +01:00
path.rs Address code review feedback 2023-12-04 14:33:46 -08:00