Skip to content

Commit

Permalink
Change the assert in is_useful to a debug_assert.
Browse files Browse the repository at this point in the history
It's hot in the `match-stress-enum` benchmark.
  • Loading branch information
Nicholas Nethercote committed Nov 9, 2021
1 parent 68568dc commit 580d357
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 580d357

Please sign in to comment.