fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB71 linesraw
1- // MIR for `main` before ScalarReplacementOfAggregates
2+ // MIR for `main` after ScalarReplacementOfAggregates
3  
4  fn main() -> () {
5      let mut _0: ();
6      let _1: i32;
7      let mut _2: (i32, bool);
8      let mut _4: [i32; 6];
9      let _5: usize;
10      let mut _6: usize;
11      let mut _7: bool;
12      let mut _9: Point;
13+     let mut _10: u32;
14+     let mut _11: u32;
15      scope 1 {
16          debug x => _1;
17          let _3: i32;
18          scope 2 {
19              debug y => _3;
20              let _8: u32;
21              scope 3 {
22                  debug z => _8;
23              }
24          }
25      }
26  
27      bb0: {
28          StorageLive(_1);
29          _2 = CheckedAdd(const 2_i32, const 2_i32);
30          assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue];
31      }
32  
33      bb1: {
34          _1 = move (_2.0: i32);
35          StorageLive(_3);
36          StorageLive(_4);
37          _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
38          StorageLive(_5);
39          _5 = const 3_usize;
40          _6 = Len(_4);
41          _7 = Lt(_5, _6);
42          assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
43      }
44  
45      bb2: {
46          _3 = _4[_5];
47          StorageDead(_5);
48          StorageDead(_4);
49          StorageLive(_8);
50-         StorageLive(_9);
51-         _9 = Point { x: const 12_u32, y: const 42_u32 };
52-         _8 = (_9.1: u32);
53-         StorageDead(_9);
54+         StorageLive(_10);
55+         StorageLive(_11);
56+         nop;
57+         _10 = const 12_u32;
58+         _11 = const 42_u32;
59+         nop;
60+         _8 = _11;
61+         StorageDead(_10);
62+         StorageDead(_11);
63+         nop;
64          nop;
65          StorageDead(_8);
66          StorageDead(_3);
67          StorageDead(_1);
68          return;
69      }
70  }
71