about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDing Xiang Fei <dingxiangfei2009@protonmail.ch>2023-08-21 03:00:21 +0800
committerDing Xiang Fei <dingxiangfei2009@protonmail.ch>2023-09-01 04:01:54 +0800
commit67553e8a11837c4b18657eedfcc272057e532bad (patch)
treeef133e8ffffe2c18275046e9188fe4bc11fab7b5
parent39cf0b5dd585cc5689ab02c9ea0e509c2fcf698b (diff)
downloadrust-67553e8a11837c4b18657eedfcc272057e532bad.tar.gz
rust-67553e8a11837c4b18657eedfcc272057e532bad.zip
update tests that are ignored by debug
-rw-r--r--tests/codegen/slice-as_chunks.rs6
-rw-r--r--tests/codegen/slice-iter-nonnull.rs6
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir135
-rw-r--r--tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir30
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir14
-rw-r--r--tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir6
-rw-r--r--tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir34
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir6
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir6
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir6
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir6
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir204
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir47
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir3
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir3
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir39
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir39
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir6
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir6
-rw-r--r--tests/run-coverage/lazy_boolean.coverage2
20 files changed, 326 insertions, 278 deletions
diff --git a/tests/codegen/slice-as_chunks.rs b/tests/codegen/slice-as_chunks.rs
index 48e3f73fc86..efac9f3d68d 100644
--- a/tests/codegen/slice-as_chunks.rs
+++ b/tests/codegen/slice-as_chunks.rs
@@ -22,9 +22,9 @@ pub fn chunks4(x: &[u8]) -> &[[u8; 4]] {
 // CHECK-LABEL: @chunks4_with_remainder
 #[no_mangle]
 pub fn chunks4_with_remainder(x: &[u8]) -> (&[[u8; 4]], &[u8]) {
-    // CHECK: and i64 %x.1, -4
-    // CHECK: and i64 %x.1, 3
-    // CHECK: lshr exact
+    // CHECK-DAG: and i64 %x.1, -4
+    // CHECK-DAG: and i64 %x.1, 3
+    // CHECK-DAG: lshr
     // CHECK-NOT: mul
     // CHECK-NOT: udiv
     // CHECK-NOT: urem
diff --git a/tests/codegen/slice-iter-nonnull.rs b/tests/codegen/slice-iter-nonnull.rs
index f7d164bc856..8749226d401 100644
--- a/tests/codegen/slice-iter-nonnull.rs
+++ b/tests/codegen/slice-iter-nonnull.rs
@@ -100,13 +100,13 @@ pub fn slice_iter_is_empty(it: &std::slice::Iter<'_, u32>) -> bool {
 // CHECK-LABEL: @slice_iter_len
 #[no_mangle]
 pub fn slice_iter_len(it: &std::slice::Iter<'_, u32>) -> usize {
-    // CHECK: %[[START:.+]] = load ptr, ptr %it,
-    // CHECK-SAME: !nonnull
-    // CHECK-SAME: !noundef
     // CHECK: %[[ENDP:.+]] = getelementptr{{.+}}ptr %it,{{.+}} 1
     // CHECK: %[[END:.+]] = load ptr, ptr %[[ENDP]]
     // CHECK-SAME: !nonnull
     // CHECK-SAME: !noundef
+    // CHECK: %[[START:.+]] = load ptr, ptr %it,
+    // CHECK-SAME: !nonnull
+    // CHECK-SAME: !noundef
 
     // CHECK: ptrtoint
     // CHECK: ptrtoint
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir
index c7fd397fcd4..838e30fa35e 100644
--- a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir
@@ -7,130 +7,111 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool {
     let mut _3: u32;
     let mut _4: u32;
     let mut _5: bool;
-    let mut _6: bool;
+    let mut _6: u32;
     let mut _7: u32;
-    let mut _8: u32;
-    let mut _9: bool;
-    let mut _10: bool;
-    let mut _11: u32;
+    let mut _8: bool;
+    let mut _9: u32;
+    let mut _10: u32;
+    let mut _11: bool;
     let mut _12: u32;
-    let mut _13: bool;
+    let mut _13: u32;
     let mut _14: bool;
     let mut _15: u32;
     let mut _16: u32;
-    let mut _17: bool;
-    let mut _18: u32;
-    let mut _19: u32;
-    let mut _20: bool;
 
     bb0: {
-        StorageLive(_14);
-        StorageLive(_10);
-        StorageLive(_6);
         StorageLive(_5);
         StorageLive(_3);
         _3 = ((*_1).0: u32);
         StorageLive(_4);
         _4 = ((*_2).0: u32);
         _5 = Eq(move _3, move _4);
-        StorageDead(_4);
-        StorageDead(_3);
         switchInt(move _5) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
-        _6 = const false;
-        goto -> bb3;
+        StorageDead(_4);
+        StorageDead(_3);
+        goto -> bb8;
     }
 
     bb2: {
-        StorageLive(_9);
-        StorageLive(_7);
-        _7 = ((*_1).1: u32);
+        StorageDead(_4);
+        StorageDead(_3);
         StorageLive(_8);
-        _8 = ((*_2).1: u32);
-        _9 = Eq(move _7, move _8);
-        StorageDead(_8);
-        StorageDead(_7);
-        _6 = move _9;
-        goto -> bb3;
+        StorageLive(_6);
+        _6 = ((*_1).1: u32);
+        StorageLive(_7);
+        _7 = ((*_2).1: u32);
+        _8 = Eq(move _6, move _7);
+        switchInt(move _8) -> [0: bb3, otherwise: bb4];
     }
 
     bb3: {
-        StorageDead(_9);
-        StorageDead(_5);
-        switchInt(move _6) -> [0: bb4, otherwise: bb5];
+        StorageDead(_7);
+        StorageDead(_6);
+        goto -> bb8;
     }
 
     bb4: {
-        _10 = const false;
-        goto -> bb6;
+        StorageDead(_7);
+        StorageDead(_6);
+        StorageLive(_11);
+        StorageLive(_9);
+        _9 = ((*_1).2: u32);
+        StorageLive(_10);
+        _10 = ((*_2).2: u32);
+        _11 = Eq(move _9, move _10);
+        switchInt(move _11) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
-        StorageLive(_13);
-        StorageLive(_11);
-        _11 = ((*_1).2: u32);
-        StorageLive(_12);
-        _12 = ((*_2).2: u32);
-        _13 = Eq(move _11, move _12);
-        StorageDead(_12);
-        StorageDead(_11);
-        _10 = move _13;
-        goto -> bb6;
+        StorageDead(_10);
+        StorageDead(_9);
+        goto -> bb8;
     }
 
     bb6: {
-        StorageDead(_13);
-        StorageDead(_6);
-        switchInt(move _10) -> [0: bb7, otherwise: bb8];
+        StorageDead(_10);
+        StorageDead(_9);
+        StorageLive(_14);
+        StorageLive(_12);
+        _12 = ((*_1).3: u32);
+        StorageLive(_13);
+        _13 = ((*_2).3: u32);
+        _14 = Eq(move _12, move _13);
+        switchInt(move _14) -> [0: bb7, otherwise: bb9];
     }
 
     bb7: {
-        _14 = const false;
-        goto -> bb9;
+        StorageDead(_13);
+        StorageDead(_12);
+        goto -> bb8;
     }
 
     bb8: {
-        StorageLive(_17);
+        _0 = const false;
+        goto -> bb10;
+    }
+
+    bb9: {
+        StorageDead(_13);
+        StorageDead(_12);
         StorageLive(_15);
-        _15 = ((*_1).3: u32);
+        _15 = ((*_1).4: u32);
         StorageLive(_16);
-        _16 = ((*_2).3: u32);
-        _17 = Eq(move _15, move _16);
+        _16 = ((*_2).4: u32);
+        _0 = Eq(move _15, move _16);
         StorageDead(_16);
         StorageDead(_15);
-        _14 = move _17;
-        goto -> bb9;
-    }
-
-    bb9: {
-        StorageDead(_17);
-        StorageDead(_10);
-        switchInt(move _14) -> [0: bb10, otherwise: bb11];
+        goto -> bb10;
     }
 
     bb10: {
-        _0 = const false;
-        goto -> bb12;
-    }
-
-    bb11: {
-        StorageLive(_20);
-        StorageLive(_18);
-        _18 = ((*_1).4: u32);
-        StorageLive(_19);
-        _19 = ((*_2).4: u32);
-        _20 = Eq(move _18, move _19);
-        StorageDead(_19);
-        StorageDead(_18);
-        _0 = move _20;
-        goto -> bb12;
-    }
-
-    bb12: {
-        StorageDead(_20);
         StorageDead(_14);
+        StorageDead(_11);
+        StorageDead(_8);
+        StorageDead(_5);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir
index 1e619bc9704..8452fa12f31 100644
--- a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir
@@ -27,12 +27,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
         StorageLive(_4);
         _4 = ((*_2).0: u32);
         _5 = Ne(move _3, move _4);
-        StorageDead(_4);
-        StorageDead(_3);
         switchInt(move _5) -> [0: bb1, otherwise: bb10];
     }
 
     bb1: {
+        StorageDead(_4);
+        StorageDead(_3);
         StorageDead(_5);
         StorageLive(_8);
         StorageLive(_6);
@@ -40,12 +40,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
         StorageLive(_7);
         _7 = ((*_2).1: u32);
         _8 = Ne(move _6, move _7);
-        StorageDead(_7);
-        StorageDead(_6);
         switchInt(move _8) -> [0: bb2, otherwise: bb9];
     }
 
     bb2: {
+        StorageDead(_7);
+        StorageDead(_6);
         StorageDead(_8);
         StorageLive(_11);
         StorageLive(_9);
@@ -53,12 +53,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
         StorageLive(_10);
         _10 = ((*_2).2: u32);
         _11 = Ne(move _9, move _10);
-        StorageDead(_10);
-        StorageDead(_9);
         switchInt(move _11) -> [0: bb3, otherwise: bb8];
     }
 
     bb3: {
+        StorageDead(_10);
+        StorageDead(_9);
         StorageDead(_11);
         StorageLive(_14);
         StorageLive(_12);
@@ -66,12 +66,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
         StorageLive(_13);
         _13 = ((*_2).3: u32);
         _14 = Ne(move _12, move _13);
-        StorageDead(_13);
-        StorageDead(_12);
         switchInt(move _14) -> [0: bb4, otherwise: bb7];
     }
 
     bb4: {
+        StorageDead(_13);
+        StorageDead(_12);
         StorageDead(_14);
         StorageLive(_17);
         StorageLive(_15);
@@ -79,42 +79,52 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
         StorageLive(_16);
         _16 = ((*_2).4: u32);
         _17 = Ne(move _15, move _16);
-        StorageDead(_16);
-        StorageDead(_15);
         switchInt(move _17) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
+        StorageDead(_16);
+        StorageDead(_15);
         StorageDead(_17);
         _0 = const true;
         goto -> bb11;
     }
 
     bb6: {
+        StorageDead(_16);
+        StorageDead(_15);
         _0 = const false;
         StorageDead(_17);
         goto -> bb11;
     }
 
     bb7: {
+        StorageDead(_13);
+        StorageDead(_12);
         _0 = const false;
         StorageDead(_14);
         goto -> bb11;
     }
 
     bb8: {
+        StorageDead(_10);
+        StorageDead(_9);
         _0 = const false;
         StorageDead(_11);
         goto -> bb11;
     }
 
     bb9: {
+        StorageDead(_7);
+        StorageDead(_6);
         _0 = const false;
         StorageDead(_8);
         goto -> bb11;
     }
 
     bb10: {
+        StorageDead(_4);
+        StorageDead(_3);
         _0 = const false;
         StorageDead(_5);
         goto -> bb11;
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir
index b2ea96f033e..75f81c5aaca 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir
@@ -40,16 +40,22 @@ fn step_forward(_1: u32, _2: usize) -> u32 {
         _5 = Eq(_4, const 1_isize);
         _6 = Not(move _5);
         StorageDead(_5);
-        StorageDead(_3);
-        StorageDead(_8);
-        switchInt(move _6) -> [0: bb3, otherwise: bb2];
+        switchInt(move _6) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
-        assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb3, unwind continue];
+        StorageDead(_3);
+        StorageDead(_8);
+        goto -> bb4;
     }
 
     bb3: {
+        StorageDead(_3);
+        StorageDead(_8);
+        assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb4, unwind continue];
+    }
+
+    bb4: {
         StorageDead(_6);
         StorageLive(_7);
         _7 = _2 as u32 (IntToInt);
diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
index 2e51faeba5a..0d79f2de10d 100644
--- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
@@ -63,17 +63,19 @@ fn int_range(_1: usize, _2: usize) -> () {
         _7 = Lt(move _5, move _6);
         StorageDead(_6);
         StorageDead(_5);
-        StorageDead(_16);
-        StorageDead(_15);
         switchInt(move _7) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
+        StorageDead(_16);
+        StorageDead(_15);
         _8 = Option::<usize>::None;
         goto -> bb5;
     }
 
     bb3: {
+        StorageDead(_16);
+        StorageDead(_15);
         _9 = (_4.0: usize);
         StorageLive(_10);
         _10 = <usize as Step>::forward_unchecked(_9, const 1_usize) -> [return: bb4, unwind continue];
diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
index 26919dd98dd..630babaa821 100644
--- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir
@@ -10,23 +10,53 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
         scope 2 {
             scope 3 {
                 debug result => _0;
-                scope 6 (inlined std::ptr::write::<u32>) {
+                scope 16 (inlined std::ptr::write::<u32>) {
                     debug dst => _1;
                     debug src => _2;
-                    scope 7 {
+                    scope 17 {
                     }
                 }
             }
             scope 4 (inlined std::ptr::read::<u32>) {
                 debug src => _1;
                 scope 5 {
+                    scope 6 (inlined std::ptr::read::runtime::<u32>) {
+                        debug src => _1;
+                        scope 7 (inlined intrinsics::is_aligned_and_not_null::<u32>) {
+                            debug ptr => _1;
+                            scope 8 (inlined ptr::const_ptr::<impl *const u32>::is_null) {
+                                debug self => _1;
+                                let mut _3: *const u8;
+                                scope 9 {
+                                    scope 10 (inlined ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
+                                        debug ptr => _3;
+                                        scope 11 (inlined ptr::const_ptr::<impl *const u8>::addr) {
+                                            debug self => _3;
+                                            scope 12 {
+                                                scope 13 (inlined ptr::const_ptr::<impl *const u8>::cast::<()>) {
+                                                    debug self => _3;
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                            scope 14 (inlined ptr::const_ptr::<impl *const u32>::is_aligned) {
+                                debug self => _1;
+                                scope 15 (inlined align_of::<u32>) {
+                                }
+                            }
+                        }
+                    }
                 }
             }
         }
     }
 
     bb0: {
+        StorageLive(_3);
         _0 = (*_1);
+        StorageDead(_3);
         (*_1) = _2;
         return;
     }
diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
index d76b46bdd94..9664ccfb094 100644
--- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
@@ -66,17 +66,19 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
         _8 = Lt(move _6, move _7);
         StorageDead(_7);
         StorageDead(_6);
-        StorageDead(_19);
-        StorageDead(_18);
         switchInt(move _8) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
+        StorageDead(_19);
+        StorageDead(_18);
         _9 = Option::<u32>::None;
         goto -> bb5;
     }
 
     bb3: {
+        StorageDead(_19);
+        StorageDead(_18);
         _10 = (_5.0: u32);
         StorageLive(_11);
         _11 = <u32 as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable];
diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
index 35f7356d47a..dc8b46b6c08 100644
--- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
@@ -66,17 +66,19 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
         _8 = Lt(move _6, move _7);
         StorageDead(_7);
         StorageDead(_6);
-        StorageDead(_19);
-        StorageDead(_18);
         switchInt(move _8) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
+        StorageDead(_19);
+        StorageDead(_18);
         _9 = Option::<u32>::None;
         goto -> bb5;
     }
 
     bb3: {
+        StorageDead(_19);
+        StorageDead(_18);
         _10 = (_5.0: u32);
         StorageLive(_11);
         _11 = <u32 as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind: bb11];
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
index 7360aa3e698..fff713b5a79 100644
--- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir
@@ -38,17 +38,19 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
         _4 = Lt(move _2, move _3);
         StorageDead(_3);
         StorageDead(_2);
-        StorageDead(_8);
-        StorageDead(_7);
         switchInt(move _4) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        StorageDead(_8);
+        StorageDead(_7);
         _0 = Option::<u32>::None;
         goto -> bb4;
     }
 
     bb2: {
+        StorageDead(_8);
+        StorageDead(_7);
         _5 = ((*_1).0: u32);
         StorageLive(_6);
         _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind unreachable];
diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir
index 61957082d8b..cc12c0122b7 100644
--- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir
@@ -38,17 +38,19 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> {
         _4 = Lt(move _2, move _3);
         StorageDead(_3);
         StorageDead(_2);
-        StorageDead(_8);
-        StorageDead(_7);
         switchInt(move _4) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        StorageDead(_8);
+        StorageDead(_7);
         _0 = Option::<u32>::None;
         goto -> bb4;
     }
 
     bb2: {
+        StorageDead(_8);
+        StorageDead(_7);
         _5 = ((*_1).0: u32);
         StorageLive(_6);
         _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind continue];
diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
index 1488779f93b..ddfd5b0fefc 100644
--- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
@@ -12,30 +12,27 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2
     let _10: &usize;
     let _11: &usize;
     let mut _16: bool;
-    let mut _17: bool;
-    let _18: &usize;
-    let mut _23: bool;
-    let _24: &usize;
-    let mut _29: bool;
-    let mut _30: bool;
-    let _31: &usize;
-    let mut _36: bool;
+    let _17: &usize;
+    let mut _22: bool;
+    let _23: &usize;
+    let mut _28: bool;
+    let _29: &usize;
+    let mut _34: &&usize;
+    let mut _35: &&usize;
+    let mut _36: &&usize;
     let mut _37: &&usize;
     let mut _38: &&usize;
     let mut _39: &&usize;
     let mut _40: &&usize;
     let mut _41: &&usize;
-    let mut _42: &&usize;
-    let mut _43: &&usize;
-    let mut _44: &&usize;
     scope 1 {
         debug a => _4;
         debug b => _6;
         debug c => _8;
         debug d => _10;
         scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _37;
-            debug other => _38;
+            debug self => _34;
+            debug other => _35;
             let mut _12: &usize;
             let mut _13: &usize;
             scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
@@ -46,39 +43,39 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2
             }
         }
         scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _41;
-            debug other => _42;
-            let mut _25: &usize;
-            let mut _26: &usize;
+            debug self => _36;
+            debug other => _37;
+            let mut _18: &usize;
+            let mut _19: &usize;
             scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _25;
-                debug other => _26;
-                let mut _27: usize;
-                let mut _28: usize;
+                debug self => _18;
+                debug other => _19;
+                let mut _20: usize;
+                let mut _21: usize;
             }
         }
         scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _39;
-            debug other => _40;
-            let mut _19: &usize;
-            let mut _20: &usize;
+            debug self => _38;
+            debug other => _39;
+            let mut _24: &usize;
+            let mut _25: &usize;
             scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _19;
-                debug other => _20;
-                let mut _21: usize;
-                let mut _22: usize;
+                debug self => _24;
+                debug other => _25;
+                let mut _26: usize;
+                let mut _27: usize;
             }
         }
         scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _43;
-            debug other => _44;
-            let mut _32: &usize;
-            let mut _33: &usize;
+            debug self => _40;
+            debug other => _41;
+            let mut _30: &usize;
+            let mut _31: &usize;
             scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _32;
-                debug other => _33;
-                let mut _34: usize;
-                let mut _35: usize;
+                debug self => _30;
+                debug other => _31;
+                let mut _32: usize;
+                let mut _33: usize;
             }
         }
     }
@@ -96,10 +93,9 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2
         StorageLive(_10);
         _9 = deref_copy (*_2);
         _10 = &((*_9).3: usize);
-        StorageLive(_17);
         StorageLive(_16);
-        StorageLive(_37);
-        StorageLive(_38);
+        StorageLive(_34);
+        StorageLive(_35);
         StorageLive(_11);
         _11 = _8;
         _12 = deref_copy _4;
@@ -111,109 +107,109 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2
         _16 = Le(move _14, move _15);
         StorageDead(_15);
         StorageDead(_14);
-        StorageDead(_11);
-        StorageDead(_38);
-        StorageDead(_37);
         switchInt(move _16) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
-        _17 = const false;
-        goto -> bb3;
+        StorageDead(_11);
+        StorageDead(_35);
+        StorageDead(_34);
+        goto -> bb4;
     }
 
     bb2: {
-        StorageLive(_23);
-        StorageLive(_39);
-        StorageLive(_40);
-        StorageLive(_18);
-        _18 = _6;
-        _19 = deref_copy _10;
-        _20 = deref_copy _18;
+        StorageDead(_11);
+        StorageDead(_35);
+        StorageDead(_34);
+        StorageLive(_22);
+        StorageLive(_36);
+        StorageLive(_37);
+        StorageLive(_17);
+        _17 = _6;
+        _18 = deref_copy _10;
+        _19 = deref_copy _17;
+        StorageLive(_20);
+        _20 = (*_18);
         StorageLive(_21);
         _21 = (*_19);
-        StorageLive(_22);
-        _22 = (*_20);
-        _23 = Le(move _21, move _22);
-        StorageDead(_22);
+        _22 = Le(move _20, move _21);
         StorageDead(_21);
-        StorageDead(_18);
-        StorageDead(_40);
-        StorageDead(_39);
-        _17 = move _23;
-        goto -> bb3;
+        StorageDead(_20);
+        switchInt(move _22) -> [0: bb3, otherwise: bb8];
     }
 
     bb3: {
-        StorageDead(_23);
-        StorageDead(_16);
-        switchInt(move _17) -> [0: bb4, otherwise: bb8];
+        StorageDead(_17);
+        StorageDead(_37);
+        StorageDead(_36);
+        goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_30);
-        StorageLive(_29);
-        StorageLive(_41);
-        StorageLive(_42);
-        StorageLive(_24);
-        _24 = _4;
-        _25 = deref_copy _8;
-        _26 = deref_copy _24;
+        StorageLive(_28);
+        StorageLive(_38);
+        StorageLive(_39);
+        StorageLive(_23);
+        _23 = _4;
+        _24 = deref_copy _8;
+        _25 = deref_copy _23;
+        StorageLive(_26);
+        _26 = (*_24);
         StorageLive(_27);
         _27 = (*_25);
-        StorageLive(_28);
-        _28 = (*_26);
-        _29 = Le(move _27, move _28);
-        StorageDead(_28);
+        _28 = Le(move _26, move _27);
         StorageDead(_27);
-        StorageDead(_24);
-        StorageDead(_42);
-        StorageDead(_41);
-        switchInt(move _29) -> [0: bb5, otherwise: bb6];
+        StorageDead(_26);
+        switchInt(move _28) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
-        _30 = const false;
+        StorageDead(_23);
+        StorageDead(_39);
+        StorageDead(_38);
+        _0 = const false;
         goto -> bb7;
     }
 
     bb6: {
-        StorageLive(_36);
-        StorageLive(_43);
-        StorageLive(_44);
-        StorageLive(_31);
-        _31 = _10;
-        _32 = deref_copy _6;
-        _33 = deref_copy _31;
-        StorageLive(_34);
-        _34 = (*_32);
-        StorageLive(_35);
-        _35 = (*_33);
-        _36 = Le(move _34, move _35);
-        StorageDead(_35);
-        StorageDead(_34);
-        StorageDead(_31);
-        StorageDead(_44);
-        StorageDead(_43);
-        _30 = move _36;
+        StorageDead(_23);
+        StorageDead(_39);
+        StorageDead(_38);
+        StorageLive(_40);
+        StorageLive(_41);
+        StorageLive(_29);
+        _29 = _10;
+        _30 = deref_copy _6;
+        _31 = deref_copy _29;
+        StorageLive(_32);
+        _32 = (*_30);
+        StorageLive(_33);
+        _33 = (*_31);
+        _0 = Le(move _32, move _33);
+        StorageDead(_33);
+        StorageDead(_32);
+        StorageDead(_29);
+        StorageDead(_41);
+        StorageDead(_40);
         goto -> bb7;
     }
 
     bb7: {
-        StorageDead(_36);
-        StorageDead(_29);
-        _0 = move _30;
+        StorageDead(_28);
         goto -> bb9;
     }
 
     bb8: {
+        StorageDead(_17);
+        StorageDead(_37);
+        StorageDead(_36);
         _0 = const true;
         goto -> bb9;
     }
 
     bb9: {
-        StorageDead(_30);
-        StorageDead(_17);
+        StorageDead(_22);
+        StorageDead(_16);
         StorageDead(_10);
         StorageDead(_8);
         StorageDead(_6);
diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
index bab9f0b58aa..7e70c6290a8 100644
--- a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir
@@ -13,9 +13,6 @@ fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41],
     let mut _11: bool;
     let mut _12: bool;
     let mut _13: bool;
-    let mut _14: bool;
-    let mut _15: bool;
-    let mut _16: bool;
     scope 1 {
         debug a => _4;
         debug b => _6;
@@ -32,64 +29,46 @@ fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41],
         _8 = ((*_7).2: usize);
         _9 = deref_copy (*_2);
         _10 = ((*_9).3: usize);
-        StorageLive(_12);
         StorageLive(_11);
         _11 = Le(_4, _8);
-        switchInt(move _11) -> [0: bb1, otherwise: bb2];
+        switchInt(move _11) -> [0: bb2, otherwise: bb1];
     }
 
     bb1: {
-        _12 = const false;
-        goto -> bb3;
+        StorageLive(_12);
+        _12 = Le(_10, _6);
+        switchInt(move _12) -> [0: bb2, otherwise: bb6];
     }
 
     bb2: {
         StorageLive(_13);
-        _13 = Le(_10, _6);
-        _12 = move _13;
-        goto -> bb3;
+        _13 = Le(_8, _4);
+        switchInt(move _13) -> [0: bb3, otherwise: bb4];
     }
 
     bb3: {
-        StorageDead(_13);
-        StorageDead(_11);
-        switchInt(move _12) -> [0: bb4, otherwise: bb8];
+        _0 = const false;
+        goto -> bb5;
     }
 
     bb4: {
-        StorageLive(_15);
-        StorageLive(_14);
-        _14 = Le(_8, _4);
-        switchInt(move _14) -> [0: bb5, otherwise: bb6];
+        _0 = Le(_6, _10);
+        goto -> bb5;
     }
 
     bb5: {
-        _15 = const false;
+        StorageDead(_13);
         goto -> bb7;
     }
 
     bb6: {
-        StorageLive(_16);
-        _16 = Le(_6, _10);
-        _15 = move _16;
+        _0 = const true;
         goto -> bb7;
     }
 
     bb7: {
-        StorageDead(_16);
-        StorageDead(_14);
-        _0 = move _15;
-        goto -> bb9;
-    }
-
-    bb8: {
-        _0 = const true;
-        goto -> bb9;
-    }
-
-    bb9: {
-        StorageDead(_15);
         StorageDead(_12);
+        StorageDead(_11);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
index 07a58309ee4..8590c9d3b83 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
@@ -58,16 +58,17 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
         StorageLive(_3);
         _3 = Len((*_1));
         _4 = Lt(_2, move _3);
-        StorageDead(_3);
         switchInt(move _4) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        StorageDead(_3);
         _0 = const Option::<&mut u32>::None;
         goto -> bb3;
     }
 
     bb2: {
+        StorageDead(_3);
         StorageLive(_8);
         StorageLive(_5);
         _5 = &raw mut (*_1);
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
index 07a58309ee4..8590c9d3b83 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
@@ -58,16 +58,17 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
         StorageLive(_3);
         _3 = Len((*_1));
         _4 = Lt(_2, move _3);
-        StorageDead(_3);
         switchInt(move _4) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        StorageDead(_3);
         _0 = const Option::<&mut u32>::None;
         goto -> bb3;
     }
 
     bb2: {
+        StorageDead(_3);
         StorageLive(_8);
         StorageLive(_5);
         _5 = &raw mut (*_1);
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
index 2f5d356a26d..8dd2cd7900f 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
@@ -17,37 +17,50 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
                 debug slice => _5;
                 let mut _7: *mut u32;
                 let mut _8: *mut u32;
-                let _14: usize;
                 let _15: usize;
+                let _16: usize;
                 scope 4 {
-                    debug this => std::ops::Range<usize>{ .0 => _14, .1 => _15, };
+                    debug this => std::ops::Range<usize>{ .0 => _15, .1 => _16, };
                     scope 5 {
                         let _6: usize;
                         scope 6 {
                             debug new_len => _6;
-                            scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+                            scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
                                 debug self => _5;
                             }
-                            scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+                            scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
                                 debug self => _7;
                                 debug count => _3;
-                                scope 9 {
+                                scope 13 {
                                 }
                             }
-                            scope 10 (inlined slice_from_raw_parts_mut::<u32>) {
+                            scope 14 (inlined slice_from_raw_parts_mut::<u32>) {
                                 debug data => _8;
                                 debug len => _6;
                                 let mut _9: *mut ();
-                                scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
+                                scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
                                     debug self => _8;
                                 }
-                                scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
+                                scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
                                     debug data_address => _9;
                                     debug metadata => _6;
                                     let mut _10: *const ();
                                     let mut _11: std::ptr::metadata::PtrComponents<[u32]>;
                                     let mut _12: std::ptr::metadata::PtrRepr<[u32]>;
-                                    scope 13 {
+                                    scope 17 {
+                                    }
+                                }
+                            }
+                        }
+                        scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) {
+                            debug this => std::ops::Range<usize>{ .0 => _15, .1 => _16, };
+                            debug slice => _5;
+                            scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) {
+                                debug self => _5;
+                                let mut _14: *const [u32];
+                                scope 9 (inlined std::ptr::metadata::<[u32]>) {
+                                    debug ptr => _14;
+                                    scope 10 {
                                     }
                                 }
                             }
@@ -63,9 +76,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         _4 = move (_2.1: usize);
         StorageLive(_5);
         _5 = &raw mut (*_1);
+        StorageLive(_6);
         StorageLive(_14);
         StorageLive(_15);
-        StorageLive(_6);
+        StorageLive(_16);
         _6 = SubUnchecked(_4, _3);
         StorageLive(_8);
         StorageLive(_7);
@@ -86,9 +100,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         StorageDead(_12);
         StorageDead(_9);
         StorageDead(_8);
-        StorageDead(_6);
-        StorageDead(_14);
+        StorageDead(_16);
         StorageDead(_15);
+        StorageDead(_14);
+        StorageDead(_6);
         StorageDead(_5);
         _0 = &mut (*_13);
         return;
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
index 2f5d356a26d..8dd2cd7900f 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
@@ -17,37 +17,50 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
                 debug slice => _5;
                 let mut _7: *mut u32;
                 let mut _8: *mut u32;
-                let _14: usize;
                 let _15: usize;
+                let _16: usize;
                 scope 4 {
-                    debug this => std::ops::Range<usize>{ .0 => _14, .1 => _15, };
+                    debug this => std::ops::Range<usize>{ .0 => _15, .1 => _16, };
                     scope 5 {
                         let _6: usize;
                         scope 6 {
                             debug new_len => _6;
-                            scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
+                            scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
                                 debug self => _5;
                             }
-                            scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
+                            scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
                                 debug self => _7;
                                 debug count => _3;
-                                scope 9 {
+                                scope 13 {
                                 }
                             }
-                            scope 10 (inlined slice_from_raw_parts_mut::<u32>) {
+                            scope 14 (inlined slice_from_raw_parts_mut::<u32>) {
                                 debug data => _8;
                                 debug len => _6;
                                 let mut _9: *mut ();
-                                scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
+                                scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
                                     debug self => _8;
                                 }
-                                scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
+                                scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
                                     debug data_address => _9;
                                     debug metadata => _6;
                                     let mut _10: *const ();
                                     let mut _11: std::ptr::metadata::PtrComponents<[u32]>;
                                     let mut _12: std::ptr::metadata::PtrRepr<[u32]>;
-                                    scope 13 {
+                                    scope 17 {
+                                    }
+                                }
+                            }
+                        }
+                        scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) {
+                            debug this => std::ops::Range<usize>{ .0 => _15, .1 => _16, };
+                            debug slice => _5;
+                            scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) {
+                                debug self => _5;
+                                let mut _14: *const [u32];
+                                scope 9 (inlined std::ptr::metadata::<[u32]>) {
+                                    debug ptr => _14;
+                                    scope 10 {
                                     }
                                 }
                             }
@@ -63,9 +76,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         _4 = move (_2.1: usize);
         StorageLive(_5);
         _5 = &raw mut (*_1);
+        StorageLive(_6);
         StorageLive(_14);
         StorageLive(_15);
-        StorageLive(_6);
+        StorageLive(_16);
         _6 = SubUnchecked(_4, _3);
         StorageLive(_8);
         StorageLive(_7);
@@ -86,9 +100,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         StorageDead(_12);
         StorageDead(_9);
         StorageDead(_8);
-        StorageDead(_6);
-        StorageDead(_14);
+        StorageDead(_16);
         StorageDead(_15);
+        StorageDead(_14);
+        StorageDead(_6);
         StorageDead(_5);
         _0 = &mut (*_13);
         return;
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
index 4edf4b4fb44..4afe2eda188 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
@@ -75,17 +75,19 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
         _8 = Lt(move _6, move _7);
         StorageDead(_7);
         StorageDead(_6);
-        StorageDead(_22);
-        StorageDead(_21);
         switchInt(move _8) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
+        StorageDead(_22);
+        StorageDead(_21);
         _9 = Option::<usize>::None;
         goto -> bb5;
     }
 
     bb3: {
+        StorageDead(_22);
+        StorageDead(_21);
         _10 = (_5.0: usize);
         StorageLive(_11);
         _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable];
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
index 8bd072fd625..48092608d9c 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
@@ -75,17 +75,19 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
         _8 = Lt(move _6, move _7);
         StorageDead(_7);
         StorageDead(_6);
-        StorageDead(_22);
-        StorageDead(_21);
         switchInt(move _8) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
+        StorageDead(_22);
+        StorageDead(_21);
         _9 = Option::<usize>::None;
         goto -> bb5;
     }
 
     bb3: {
+        StorageDead(_22);
+        StorageDead(_21);
         _10 = (_5.0: usize);
         StorageLive(_11);
         _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind: bb12];
diff --git a/tests/run-coverage/lazy_boolean.coverage b/tests/run-coverage/lazy_boolean.coverage
index 2d927a08356..8f14082ef68 100644
--- a/tests/run-coverage/lazy_boolean.coverage
+++ b/tests/run-coverage/lazy_boolean.coverage
@@ -32,7 +32,7 @@
                                           ^0
    LL|       |
    LL|       |    if
-   LL|      1|        !
+   LL|       |        !
    LL|      1|        is_true
    LL|      0|    {
    LL|      0|        a = 2