fork/rust

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

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

master
1.1 KiB41 linesraw
1- // MIR for `main` before DataflowConstProp
2+ // MIR for `main` after DataflowConstProp
3  
4  fn main() -> () {
5      let mut _0: ();
6      let mut _1: u8;
7      let mut _2: u8;
8      let mut _3: u8;
9      scope 1 {
10      }
11      scope 2 (inlined <u8 as Add>::add) {
12          debug self => _2;
13          debug other => _3;
14          let mut _4: (u8, bool);
15      }
16  
17      bb0: {
18          StorageLive(_1);
19          StorageLive(_2);
20          _2 = const u8::MAX;
21          StorageLive(_3);
22          _3 = const 1_u8;
23          StorageLive(_4);
24-         _4 = CheckedAdd(_2, _3);
25-         assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable];
26+         _4 = CheckedAdd(const u8::MAX, const 1_u8);
27+         assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable];
28      }
29  
30      bb1: {
31-         _1 = move (_4.0: u8);
32+         _1 = const 0_u8;
33          StorageDead(_4);
34          StorageDead(_3);
35          StorageDead(_2);
36          StorageDead(_1);
37          _0 = const ();
38          return;
39      }
40  }
41