]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/const_prop/inherit_overflow.main.ConstProp.diff
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / mir-opt / const_prop / inherit_overflow.main.ConstProp.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3
4 fn main() -> () {
5 let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
6 let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
7 let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
8 let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
9 scope 1 {
10 }
11 scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:8:13: 8:47
12 debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
13 debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
14 let mut _4: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
15 }
16
17 bb0: {
18 StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
19 StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
20 _2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
21 StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
22 _3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
23 - _4 = CheckedAdd(_2, _3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
24 - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
25 + _4 = const (0_u8, true); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
26 + assert(!const true, "attempt to compute `{} + {}`, which would overflow", _2, _3) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
27 }
28
29 bb1: {
30 - _1 = move (_4.0: u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
31 + _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
32 StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
33 StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
34 StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
35 _0 = const (); // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
36 return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
37 }
38 }
39