rust/compiler/rustc_ast/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
..
attr Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
expand Generate better function argument names in global_allocator expansion 2023-08-06 07:36:05 -07:00
util Add gen blocks to ast and do some broken ast lowering 2023-10-27 13:05:48 +00:00
ast.rs Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors 2023-12-08 17:08:52 +00:00
ast_traits.rs Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
entry.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
format.rs get auto traits for parallel rustc 2023-08-02 16:21:45 +08:00
lib.rs Add HashStable_NoContext to simplify HashStable implementations in rustc_type_ir 2023-11-21 05:49:44 +00:00
mut_visit.rs Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors 2023-12-08 17:08:52 +00:00
node_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
ptr.rs make rustc compilable 2023-04-16 07:25:13 +00:00
token.rs Detect Python-like slicing and suggest how to fix 2023-11-27 21:48:10 +09:00
tokenstream.rs More detail when expecting expression but encountering bad macro argument 2023-11-16 16:19:04 +00:00
visit.rs Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors 2023-12-08 17:08:52 +00:00