2023-04-30 09:53:24 -05:00
|
|
|
// MIR for `step_forward` after PreCodegen
|
|
|
|
|
|
|
|
fn step_forward(_1: u32, _2: usize) -> u32 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _1;
|
|
|
|
debug n => _2;
|
|
|
|
let mut _0: u32;
|
|
|
|
scope 1 (inlined <u32 as Step>::forward) {
|
|
|
|
debug start => _1;
|
|
|
|
debug n => _2;
|
|
|
|
let _3: std::option::Option<u32>;
|
2023-01-12 14:04:42 -06:00
|
|
|
let mut _4: &std::option::Option<u32>;
|
|
|
|
let mut _7: bool;
|
|
|
|
let mut _8: u32;
|
2023-04-30 09:53:24 -05:00
|
|
|
scope 2 {
|
|
|
|
}
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 3 (inlined Option::<u32>::is_none) {
|
2023-01-12 14:04:42 -06:00
|
|
|
debug self => _4;
|
|
|
|
let mut _6: bool;
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 4 (inlined Option::<u32>::is_some) {
|
2023-01-12 14:04:42 -06:00
|
|
|
debug self => _4;
|
|
|
|
let mut _5: isize;
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
}
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 5 (inlined core::num::<impl u32>::wrapping_add) {
|
|
|
|
debug self => _1;
|
2023-01-12 14:04:42 -06:00
|
|
|
debug rhs => _8;
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-01-12 14:04:42 -06:00
|
|
|
StorageLive(_7);
|
|
|
|
StorageLive(_4);
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_3);
|
2023-06-23 11:53:09 -05:00
|
|
|
_3 = <u32 as Step>::forward_checked(_1, _2) -> [return: bb1, unwind continue];
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-01-12 14:04:42 -06:00
|
|
|
_4 = &_3;
|
|
|
|
StorageLive(_6);
|
2023-03-11 09:27:44 -06:00
|
|
|
StorageLive(_5);
|
2023-01-12 14:04:42 -06:00
|
|
|
_5 = discriminant(_3);
|
|
|
|
_6 = Eq(_5, const 1_isize);
|
2023-03-11 09:27:44 -06:00
|
|
|
StorageDead(_5);
|
2023-01-12 14:04:42 -06:00
|
|
|
_7 = Not(move _6);
|
|
|
|
StorageDead(_6);
|
|
|
|
switchInt(move _7) -> [0: bb2, otherwise: bb3];
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-08-20 14:00:21 -05:00
|
|
|
StorageDead(_3);
|
2023-01-12 14:04:42 -06:00
|
|
|
StorageDead(_4);
|
2023-08-20 14:00:21 -05:00
|
|
|
goto -> bb4;
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-08-20 14:00:21 -05:00
|
|
|
StorageDead(_3);
|
2023-01-12 14:04:42 -06:00
|
|
|
StorageDead(_4);
|
2023-08-20 14:00:21 -05:00
|
|
|
assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb4, unwind continue];
|
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_7);
|
2023-01-12 14:04:42 -06:00
|
|
|
StorageLive(_8);
|
|
|
|
_8 = _2 as u32 (IntToInt);
|
|
|
|
_0 = Add(_1, _8);
|
|
|
|
StorageDead(_8);
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2023-04-30 09:53:24 -05:00
|
|
|
}
|
|
|
|
}
|