2020-04-27 17:57:58 -05:00
- // MIR for `main` before ConstProp
+ // MIR for `main` after ConstProp
fn main() -> () {
2023-06-06 08:47:00 -05:00
let mut _0: ();
let _1: i32;
let mut _3: i32;
let mut _4: bool;
let mut _5: bool;
let mut _6: bool;
let mut _7: bool;
2020-04-27 17:57:58 -05:00
scope 1 {
2023-06-06 08:47:00 -05:00
debug y => _1;
let _2: i32;
2020-04-27 17:57:58 -05:00
scope 2 {
2023-06-06 08:47:00 -05:00
debug _z => _2;
2020-04-27 17:57:58 -05:00
}
}
bb0: {
2023-06-06 08:47:00 -05:00
StorageLive(_1);
_1 = const 0_i32;
StorageLive(_2);
StorageLive(_3);
- _3 = _1;
- _4 = Eq(_3, const 0_i32);
2023-06-23 11:53:09 -05:00
- assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue];
2023-06-06 08:47:00 -05:00
+ _3 = const 0_i32;
+ _4 = const true;
2023-06-23 11:53:09 -05:00
+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue];
2020-04-27 17:57:58 -05:00
}
bb1: {
2023-06-06 08:47:00 -05:00
- _5 = Eq(_3, const -1_i32);
- _6 = Eq(const 1_i32, const i32::MIN);
- _7 = BitAnd(move _5, move _6);
2023-06-23 11:53:09 -05:00
- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue];
2023-06-06 08:47:00 -05:00
+ _5 = const false;
+ _6 = const false;
+ _7 = const false;
2023-02-07 13:24:21 -06:00
+ assert(!const false, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, const 0_i32) -> [success: bb2, unwind continue];
2020-04-27 17:57:58 -05:00
}
bb2: {
2023-02-07 13:24:21 -06:00
- _2 = Rem(const 1_i32, move _3);
+ _2 = Rem(const 1_i32, const 0_i32);
2023-06-06 08:47:00 -05:00
StorageDead(_3);
_0 = const ();
StorageDead(_2);
StorageDead(_1);
return;
2020-04-27 17:57:58 -05:00
}
}