Skip to content

Commit

Permalink
Remove incorrect assert
Browse files Browse the repository at this point in the history
It's incorrect because `CtorSet::split` returns a non-present
constructor into `present` in one specific case: variable-length slices
of an empty type. That's because empty constructors of arity 0 break the
algorithm. This is a tricky corner case that's hard to do cleanly. The
assert wasn't adding much anyway.
  • Loading branch information
Nadrieril committed Jan 7, 2024
1 parent 4c23861 commit 30ca1c0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions compiler/rustc_pattern_analysis/src/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
column.expand_and_push(subpat);
}
}

assert!(
!specialized_columns[0].is_empty(),
"ctor {ctor:?} was listed as present but isn't;
there is an inconsistency between `Constructor::is_covered_by` and `ConstructorSet::split`"
);
specialized_columns
}
}
Expand Down

0 comments on commit 30ca1c0

Please sign in to comment.