fork/rust

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

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

master
1.1 KiB49 linesraw
1- // MIR for `outer` before Inline
2+ // MIR for `outer` after Inline
3  
4  fn outer() -> usize {
5      let mut _0: usize;
6+     scope 1 (inlined inner) {
7+         let mut _1: &[bool; 1];
8+         let mut _2: bool;
9+         let mut _3: bool;
10+         scope 2 {
11+             debug buffer => const _;
12+             scope 3 {
13+                 debug index => _0;
14+             }
15+         }
16+     }
17  
18      bb0: {
19-         _0 = inner() -> [return: bb1, unwind unreachable];
20+         StorageLive(_1);
21+         StorageLive(_2);
22+         _1 = const _;
23+         _0 = index() -> [return: bb1, unwind unreachable];
24      }
25  
26      bb1: {
27+         StorageLive(_3);
28+         _2 = Lt(_0, const 1_usize);
29+         assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind unreachable];
30+     }
31+ 
32+     bb2: {
33+         _3 = (*_1)[_0];
34+         switchInt(move _3) -> [0: bb3, otherwise: bb4];
35+     }
36+ 
37+     bb3: {
38+         _0 = const 0_usize;
39+         goto -> bb4;
40+     }
41+ 
42+     bb4: {
43+         StorageDead(_3);
44+         StorageDead(_2);
45+         StorageDead(_1);
46          return;
47      }
48  }
49