| 
 | 1 | +- // MIR for `main` before CopyProp  | 
 | 2 | ++ // MIR for `main` after CopyProp  | 
 | 3 | +    | 
 | 4 | +  fn main() -> () {  | 
 | 5 | +      let mut _0: ();                      // return place in scope 0 at $DIR/issue_107511.rs:+0:11: +0:11  | 
 | 6 | +      let mut _1: i32;                     // in scope 0 at $DIR/issue_107511.rs:+1:9: +1:16  | 
 | 7 | +      let mut _3: std::ops::Range<usize>;  // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 8 | +      let mut _4: std::ops::Range<usize>;  // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 9 | +      let mut _5: usize;                   // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 10 | +      let mut _6: &[i32];                  // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 11 | +      let mut _7: &[i32; 4];               // in scope 0 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 12 | +      let mut _9: ();                      // in scope 0 at $DIR/issue_107511.rs:+0:1: +9:2  | 
 | 13 | +      let _10: ();                         // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 14 | +      let mut _11: std::option::Option<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 15 | +      let mut _12: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 16 | +      let mut _13: &mut std::ops::Range<usize>; // in scope 0 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 17 | +      let mut _14: isize;                  // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 18 | +      let mut _15: !;                      // in scope 0 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 19 | +      let mut _17: i32;                    // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 20 | +      let _18: usize;                      // in scope 0 at $DIR/issue_107511.rs:+7:18: +7:19  | 
 | 21 | +      let mut _19: usize;                  // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 22 | +      let mut _20: bool;                   // in scope 0 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 23 | +      scope 1 {  | 
 | 24 | +          debug sum => _1;                 // in scope 1 at $DIR/issue_107511.rs:+1:9: +1:16  | 
 | 25 | +          let _2: [i32; 4];                // in scope 1 at $DIR/issue_107511.rs:+2:9: +2:10  | 
 | 26 | +          scope 2 {  | 
 | 27 | +              debug a => _2;               // in scope 2 at $DIR/issue_107511.rs:+2:9: +2:10  | 
 | 28 | +              let mut _8: std::ops::Range<usize>; // in scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 29 | +              scope 3 {  | 
 | 30 | +                  debug iter => _8;        // in scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 31 | +                  let _16: usize;          // in scope 3 at $DIR/issue_107511.rs:+6:9: +6:10  | 
 | 32 | +                  scope 4 {  | 
 | 33 | +                      debug i => _16;      // in scope 4 at $DIR/issue_107511.rs:+6:9: +6:10  | 
 | 34 | +                  }  | 
 | 35 | +              }  | 
 | 36 | +          }  | 
 | 37 | +      }  | 
 | 38 | +    | 
 | 39 | +      bb0: {  | 
 | 40 | +          StorageLive(_1);                 // scope 0 at $DIR/issue_107511.rs:+1:9: +1:16  | 
 | 41 | +          _1 = const 0_i32;                // scope 0 at $DIR/issue_107511.rs:+1:19: +1:20  | 
 | 42 | +          StorageLive(_2);                 // scope 1 at $DIR/issue_107511.rs:+2:9: +2:10  | 
 | 43 | +          _2 = [const 0_i32, const 10_i32, const 20_i32, const 30_i32]; // scope 1 at $DIR/issue_107511.rs:+2:13: +2:28  | 
 | 44 | +          StorageLive(_3);                 // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 45 | +          StorageLive(_4);                 // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 46 | +          StorageLive(_5);                 // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 47 | +          StorageLive(_6);                 // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 48 | +          StorageLive(_7);                 // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 49 | +          _7 = &_2;                        // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 50 | +          _6 = move _7 as &[i32] (Pointer(Unsize)); // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 51 | +          StorageDead(_7);                 // scope 2 at $DIR/issue_107511.rs:+6:17: +6:18  | 
 | 52 | +          _5 = core::slice::<impl [i32]>::len(move _6) -> bb1; // scope 2 at $DIR/issue_107511.rs:+6:17: +6:24  | 
 | 53 | +                                           // mir::Constant  | 
 | 54 | +                                           // + span: $DIR/issue_107511.rs:10:19: 10:22  | 
 | 55 | +                                           // + literal: Const { ty: for<'a> fn(&'a [i32]) -> usize {core::slice::<impl [i32]>::len}, val: Value(<ZST>) }  | 
 | 56 | +      }  | 
 | 57 | +    | 
 | 58 | +      bb1: {  | 
 | 59 | +          StorageDead(_6);                 // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24  | 
 | 60 | +          Deinit(_4);                      // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 61 | +          (_4.0: usize) = const 0_usize;   // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 62 | +          (_4.1: usize) = move _5;         // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 63 | +          StorageDead(_5);                 // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24  | 
 | 64 | +          _3 = <std::ops::Range<usize> as IntoIterator>::into_iter(move _4) -> bb2; // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 65 | +                                           // mir::Constant  | 
 | 66 | +                                           // + span: $DIR/issue_107511.rs:10:14: 10:24  | 
 | 67 | +                                           // + literal: Const { ty: fn(std::ops::Range<usize>) -> <std::ops::Range<usize> as IntoIterator>::IntoIter {<std::ops::Range<usize> as IntoIterator>::into_iter}, val: Value(<ZST>) }  | 
 | 68 | +      }  | 
 | 69 | +    | 
 | 70 | +      bb2: {  | 
 | 71 | +          StorageDead(_4);                 // scope 2 at $DIR/issue_107511.rs:+6:23: +6:24  | 
 | 72 | +          StorageLive(_8);                 // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 73 | +          _8 = move _3;                    // scope 2 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 74 | +          goto -> bb3;                     // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 75 | +      }  | 
 | 76 | +    | 
 | 77 | +      bb3: {  | 
 | 78 | +-         StorageLive(_10);                // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 79 | +          StorageLive(_11);                // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 80 | +          StorageLive(_12);                // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 81 | +          StorageLive(_13);                // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 82 | +          _13 = &mut _8;                   // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 83 | +          _12 = &mut (*_13);               // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 84 | +          _11 = <std::ops::Range<usize> as Iterator>::next(move _12) -> bb4; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 85 | +                                           // mir::Constant  | 
 | 86 | +                                           // + span: $DIR/issue_107511.rs:10:14: 10:24  | 
 | 87 | +                                           // + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<usize>) -> Option<<std::ops::Range<usize> as Iterator>::Item> {<std::ops::Range<usize> as Iterator>::next}, val: Value(<ZST>) }  | 
 | 88 | +      }  | 
 | 89 | +    | 
 | 90 | +      bb4: {  | 
 | 91 | +          StorageDead(_12);                // scope 3 at $DIR/issue_107511.rs:+6:23: +6:24  | 
 | 92 | +          _14 = discriminant(_11);         // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 93 | +          switchInt(move _14) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 94 | +      }  | 
 | 95 | +    | 
 | 96 | +      bb5: {  | 
 | 97 | +-         StorageLive(_16);                // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10  | 
 | 98 | +          _16 = ((_11 as Some).0: usize);  // scope 3 at $DIR/issue_107511.rs:+6:9: +6:10  | 
 | 99 | +          StorageLive(_17);                // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 100 | +-         StorageLive(_18);                // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19  | 
 | 101 | +-         _18 = _16;                       // scope 4 at $DIR/issue_107511.rs:+7:18: +7:19  | 
 | 102 | +          _19 = Len(_2);                   // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 103 | +-         _20 = Lt(_18, _19);              // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 104 | +-         assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> bb8; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 105 | ++         _20 = Lt(_16, _19);              // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 106 | ++         assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> bb8; // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 107 | +      }  | 
 | 108 | +    | 
 | 109 | +      bb6: {  | 
 | 110 | +          unreachable;                     // scope 3 at $DIR/issue_107511.rs:+6:14: +6:24  | 
 | 111 | +      }  | 
 | 112 | +    | 
 | 113 | +      bb7: {  | 
 | 114 | +          _0 = const ();                   // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 115 | +          StorageDead(_13);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 116 | +          StorageDead(_11);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 117 | +-         StorageDead(_10);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 118 | +          StorageDead(_8);                 // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 119 | +          StorageDead(_3);                 // scope 2 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 120 | +          StorageDead(_2);                 // scope 1 at $DIR/issue_107511.rs:+9:1: +9:2  | 
 | 121 | +          StorageDead(_1);                 // scope 0 at $DIR/issue_107511.rs:+9:1: +9:2  | 
 | 122 | +          return;                          // scope 0 at $DIR/issue_107511.rs:+9:2: +9:2  | 
 | 123 | +      }  | 
 | 124 | +    | 
 | 125 | +      bb8: {  | 
 | 126 | +-         _17 = _2[_18];                   // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 127 | ++         _17 = _2[_16];                   // scope 4 at $DIR/issue_107511.rs:+7:16: +7:20  | 
 | 128 | +          _1 = Add(_1, move _17);          // scope 4 at $DIR/issue_107511.rs:+7:9: +7:20  | 
 | 129 | +          StorageDead(_17);                // scope 4 at $DIR/issue_107511.rs:+7:19: +7:20  | 
 | 130 | +-         StorageDead(_18);                // scope 4 at $DIR/issue_107511.rs:+7:20: +7:21  | 
 | 131 | +-         _10 = const ();                  // scope 4 at $DIR/issue_107511.rs:+6:25: +8:6  | 
 | 132 | +-         StorageDead(_16);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 133 | +          StorageDead(_13);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 134 | +          StorageDead(_11);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 135 | +-         StorageDead(_10);                // scope 3 at $DIR/issue_107511.rs:+8:5: +8:6  | 
 | 136 | +-         _9 = const ();                   // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 137 | +          goto -> bb3;                     // scope 3 at $DIR/issue_107511.rs:+6:5: +8:6  | 
 | 138 | +      }  | 
 | 139 | +  }  | 
 | 140 | +    | 
0 commit comments