about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lints.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2024-01-07 11:05:18 +0100
committerNadrieril <nadrieril+git@gmail.com>2024-01-07 16:45:44 +0100
commit30ca1c0a5db532d75f7785e9fb530e0b4388bbd5 (patch)
tree649297f77c5eeaa775f84f039a31e11c574de052 /compiler/rustc_pattern_analysis/src/lints.rs
parent4c2386137a8e9a7c61036594e717ab1ad443c2d5 (diff)
downloadrust-30ca1c0a5db532d75f7785e9fb530e0b4388bbd5.tar.gz
rust-30ca1c0a5db532d75f7785e9fb530e0b4388bbd5.zip
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.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lints.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lints.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs
index 4303022eef3..de87875fd0e 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
     }
 }