fork/rust

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

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

master
1.1 KiB39 linesraw
1- // MIR for `main` before DataflowConstProp
2+ // MIR for `main` after DataflowConstProp
3  
4  fn main() -> () {
5      let mut _0: ();
6      let _1: u8;
7      let mut _2: [u8; 5000];
8      let _3: usize;
9      let mut _4: usize;
10      let mut _5: bool;
11      scope 1 {
12          debug x => _1;
13      }
14  
15      bb0: {
16          StorageLive(_1);
17          StorageLive(_2);
18          _2 = [const 0_u8; 5000];
19          StorageLive(_3);
20          _3 = const 2_usize;
21-         _4 = Len(_2);
22-         _5 = Lt(_3, _4);
23-         assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue];
24+         _4 = const 5000_usize;
25+         _5 = const true;
26+         assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue];
27      }
28  
29      bb1: {
30-         _1 = _2[_3];
31+         _1 = _2[2 of 3];
32          StorageDead(_3);
33          StorageDead(_2);
34          _0 = const ();
35          StorageDead(_1);
36          return;
37      }
38  }
39