fork/rust

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

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

master
1.3 KiB47 linesraw
1- // MIR for `main` before ConstProp
2+ // MIR for `main` after ConstProp
3  
4  fn main() -> () {
5      let mut _0: ();
6      let _1: u32;
7      let mut _2: &[u32];
8      let mut _3: &[u32; 3];
9      let _4: &[u32; 3];
10      let _5: [u32; 3];
11      let _6: usize;
12      let mut _7: usize;
13      let mut _8: bool;
14      let mut _9: &[u32; 3];
15  
16      bb0: {
17          StorageLive(_1);
18          StorageLive(_2);
19          StorageLive(_3);
20          StorageLive(_4);
21          _9 = const _;
22          _4 = _9;
23          _3 = _4;
24          _2 = move _3 as &[u32] (PointerCoercion(Unsize));
25          StorageDead(_3);
26          StorageLive(_6);
27          _6 = const 1_usize;
28-         _7 = Len((*_2));
29-         _8 = Lt(_6, _7);
30-         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable];
31+         _7 = const 3_usize;
32+         _8 = const true;
33+         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable];
34      }
35  
36      bb1: {
37-         _1 = (*_2)[_6];
38+         _1 = const 2_u32;
39          StorageDead(_6);
40          StorageDead(_4);
41          StorageDead(_2);
42          StorageDead(_1);
43          _0 = const ();
44          return;
45      }
46  }
47