From 30ca1c0a5db532d75f7785e9fb530e0b4388bbd5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 7 Jan 2024 11:05:18 +0100 Subject: [PATCH] Remove incorrect `assert` 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. --- compiler/rustc_pattern_analysis/src/lints.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs index 4303022eef30c..de87875fd0edb 100644 --- a/compiler/rustc_pattern_analysis/src/lints.rs +++ b/compiler/rustc_pattern_analysis/src/lints.rs @@ -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 } }