2021-01-11 17:24:41 +00: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 09:47:00 -04:00
|
|
|
let mut _0: i32;
|
|
|
|
let mut _1: (i32, bool);
|
2021-01-11 17:24:41 +00:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 09:47:00 -04:00
|
|
|
_1 = CheckedAdd(const 5_i32, const 6_i32);
|
2023-06-23 17:53:09 +01: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 19:42:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 09:47:00 -04:00
|
|
|
_0 = move (_1.0: i32);
|
|
|
|
return;
|
2021-01-11 17:24:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// MIR FOR CTFE
|
|
|
|
fn foo() -> i32 {
|
2023-06-06 09:47:00 -04:00
|
|
|
let mut _0: i32;
|
|
|
|
let mut _1: (i32, bool);
|
2021-01-11 17:24:41 +00:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 09:47:00 -04:00
|
|
|
_1 = CheckedAdd(const 5_i32, const 6_i32);
|
2023-06-23 17:53:09 +01: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 17:24:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 09:47:00 -04:00
|
|
|
_0 = move (_1.0: i32);
|
|
|
|
return;
|
2021-01-11 17:24:41 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-06 13:27:59 -06:00
|
|
|
|
|
|
|
fn main() -> () {
|
2023-06-06 09:47:00 -04:00
|
|
|
let mut _0: ();
|
|
|
|
let _1: i32;
|
2022-01-06 13:27:59 -06:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-23 17:53:09 +01:00
|
|
|
_1 = foo() -> [return: bb1, unwind continue];
|
2022-01-06 13:27:59 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 09:47:00 -04:00
|
|
|
return;
|
2022-01-06 13:27:59 -06:00
|
|
|
}
|
|
|
|
}
|