Skip to content

Commit

Permalink
Auto merge of rust-lang#90746 - nnethercote:opt-pattern-matching, r=N…
Browse files Browse the repository at this point in the history
…adrieril

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`
  • Loading branch information
bors committed Nov 11, 2021
2 parents 3d29b68 + 580d357 commit 936238a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ fn is_useful<'p, 'tcx>(
return ret;
}

assert!(rows.iter().all(|r| r.len() == v.len()));
debug_assert!(rows.iter().all(|r| r.len() == v.len()));

let ty = v.head().ty();
let is_non_exhaustive = cx.is_foreign_non_exhaustive_enum(ty);
Expand Down

0 comments on commit 936238a

Please sign in to comment.