2021-01-11 11:24:41 -06:00
|
|
|
// WARNING: This output format is intended for human consumers only
|
|
|
|
// and is subject to change without notice. Knock yourself out.
|
|
|
|
fn foo() -> i32 {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: i32;
|
|
|
|
let mut _1: (i32, bool);
|
2021-01-11 11:24:41 -06:00
|
|
|
|
|
|
|
bb0: {
|
2024-05-16 04:07:31 -05:00
|
|
|
_1 = AddWithOverflow(const 5_i32, const 6_i32);
|
2023-06-23 11:53:09 -05:00
|
|
|
assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
|
2023-04-05 14:42:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = move (_1.0: i32);
|
|
|
|
return;
|
2021-01-11 11:24:41 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// MIR FOR CTFE
|
|
|
|
fn foo() -> i32 {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: i32;
|
|
|
|
let mut _1: (i32, bool);
|
2021-01-11 11:24:41 -06:00
|
|
|
|
|
|
|
bb0: {
|
2024-05-16 04:07:31 -05:00
|
|
|
_1 = AddWithOverflow(const 5_i32, const 6_i32);
|
2023-06-23 11:53:09 -05:00
|
|
|
assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
|
2021-01-11 11:24:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = move (_1.0: i32);
|
|
|
|
return;
|
2021-01-11 11:24:41 -06:00
|
|
|
}
|
|
|
|
}
|
2022-01-06 13:27:59 -06:00
|
|
|
|
|
|
|
fn main() -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: ();
|
|
|
|
let _1: i32;
|
2022-01-06 13:27:59 -06:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-23 11:53:09 -05:00
|
|
|
_1 = foo() -> [return: bb1, unwind continue];
|
2022-01-06 13:27:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2022-01-06 13:27:59 -06:00
|
|
|
}
|
|
|
|
}
|