This commit is contained in:
Nadrieril 2023-10-21 23:04:17 +02:00
parent 26f340a0d5
commit a134f1624c
2 changed files with 10 additions and 0 deletions

View file

@ -884,6 +884,9 @@ fn collect_nonexhaustive_missing_variants<'p, 'tcx>(
cx: &MatchCheckCtxt<'p, 'tcx>,
column: &[&DeconstructedPat<'p, 'tcx>],
) -> Vec<WitnessPat<'tcx>> {
if column.is_empty() {
return Vec::new();
}
let ty = column[0].ty();
let pcx = &PatCtxt { cx, ty, span: DUMMY_SP, is_top_level: false };

View file

@ -251,3 +251,10 @@ fn main() {
pub fn takes_non_exhaustive(_: NonExhaustiveEnum) {
let _closure = |_: NonExhaustiveEnum| {};
}
// ICE #117033
enum Void {}
#[deny(non_exhaustive_omitted_patterns)]
pub fn void(v: Void) -> ! {
match v {}
}