Skip to content

Commit 936238a

Browse files
committed
Auto merge of #90746 - nnethercote:opt-pattern-matching, r=Nadrieril
Optimize pattern matching These commits speed up the `match-stress-enum` benchmark, which is very artificial, but the changes are simple enough that it's probably worth doing. r? `@Nadrieril`
2 parents 3d29b68 + 580d357 commit 936238a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_build/src/thir/pattern/usefulness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ fn is_useful<'p, 'tcx>(
797797
return ret;
798798
}
799799

800-
assert!(rows.iter().all(|r| r.len() == v.len()));
800+
debug_assert!(rows.iter().all(|r| r.len() == v.len()));
801801

802802
let ty = v.head().ty();
803803
let is_non_exhaustive = cx.is_foreign_non_exhaustive_enum(ty);

0 commit comments

Comments
 (0)