Skip to content

Commit db2fd62

Browse files
committed
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.
1 parent e4bf46e commit db2fd62

File tree

1 file changed

+0
-6
lines changed
  • compiler/rustc_pattern_analysis/src

1 file changed

+0
-6
lines changed

compiler/rustc_pattern_analysis/src/lints.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
9494
column.expand_and_push(subpat);
9595
}
9696
}
97-
98-
assert!(
99-
!specialized_columns[0].is_empty(),
100-
"ctor {ctor:?} was listed as present but isn't;
101-
there is an inconsistency between `Constructor::is_covered_by` and `ConstructorSet::split`"
102-
);
10397
specialized_columns
10498
}
10599
}

0 commit comments

Comments
 (0)