rust/compiler/rustc_hir/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
..
arena.rs Remove unused arena kinds in rustc_hir and rustc_middle. 2023-11-20 15:05:26 +11:00
def_path_hash_map.rs
def.rs rustc: Harmonize DefKind and DefPathData 2023-12-03 16:24:56 +03:00
definitions.rs rustc: Harmonize DefKind and DefPathData 2023-12-03 16:24:56 +03:00
diagnostic_items.rs
hir_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
hir.rs Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors 2023-12-08 17:08:52 +00:00
intravisit.rs Remove #[rustc_host], use internal desugaring 2023-12-05 01:15:21 +00:00
lang_items.rs Wrap a long line. 2023-11-21 15:34:41 +11:00
lib.rs Remove unused feature. 2023-11-20 16:20:45 +11:00
pat_util.rs Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
stable_hash_impls.rs
target.rs Don't store lazyness in DefKind 2023-09-26 02:53:59 +00:00
tests.rs Replace two create_default_session_if_not_set_then uses. 2023-11-02 19:35:04 +11:00
weak_lang_items.rs