about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@apple.com>2021-11-09 16:13:44 +1100
committerNicholas Nethercote <nnethercote@apple.com>2021-11-09 16:13:44 +1100
commit580d357b5adef605fc731d295ca53ab8532e26fb (patch)
treeb9b34dbfb02a266984b24d9327becf7156b0d09b
parent68568dcb8ff49a3d70f4cc2d9215b5753d088738 (diff)
downloadrust-580d357b5adef605fc731d295ca53ab8532e26fb.tar.gz
rust-580d357b5adef605fc731d295ca53ab8532e26fb.zip
Change the `assert` in `is_useful` to a `debug_assert`.
It's hot in the `match-stress-enum` benchmark.
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/usefulness.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
index d959d2f7f6f..067b0506e30 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
@@ -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);