about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander <alex.m.vlasov@gmail.com>2021-10-06 20:37:24 +0200
committerAlexander <alex.m.vlasov@gmail.com>2021-10-06 20:37:24 +0200
commita31518fbf4843e7c998131a97f4a35beb60dd625 (patch)
tree98b43df612cb897dc01f72044b83e4cbe4e2d4aa
parent4c3465c69e564be02c4fc628c2321b8fb764fd63 (diff)
downloadrust-a31518fbf4843e7c998131a97f4a35beb60dd625.tar.gz
rust-a31518fbf4843e7c998131a97f4a35beb60dd625.zip
opt-level >= 4
-rw-r--r--compiler/rustc_mir_transform/src/normalize_array_len.rs6
-rw-r--r--src/test/mir-opt/lower_array_len.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/normalize_array_len.rs b/compiler/rustc_mir_transform/src/normalize_array_len.rs
index 7ed4cb402c7..60e71130cd1 100644
--- a/compiler/rustc_mir_transform/src/normalize_array_len.rs
+++ b/compiler/rustc_mir_transform/src/normalize_array_len.rs
@@ -15,9 +15,9 @@ pub struct NormalizeArrayLen;
 
 impl<'tcx> MirPass<'tcx> for NormalizeArrayLen {
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
-        // if tcx.sess.mir_opt_level() < 3 {
-        //     return;
-        // }
+        if tcx.sess.mir_opt_level() < 4 {
+            return;
+        }
 
         // early returns for edge cases of highly unrolled functions
         if body.basic_blocks().len() > MAX_NUM_BLOCKS {
diff --git a/src/test/mir-opt/lower_array_len.rs b/src/test/mir-opt/lower_array_len.rs
index 994204058f6..fc12ee75fcf 100644
--- a/src/test/mir-opt/lower_array_len.rs
+++ b/src/test/mir-opt/lower_array_len.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Z mir-opt-level=3
+// compile-flags: -Z mir-opt-level=4
 
 // EMIT_MIR lower_array_len.array_bound.NormalizeArrayLen.diff
 // EMIT_MIR lower_array_len.array_bound.SimplifyLocals.diff