rust/tests/mir-opt/lower_intrinsics.option_payload.LowerIntrinsics.panic-abort.diff

49 lines
1.3 KiB
Diff
Raw Normal View History

2023-03-15 10:29:52 -05:00
- // MIR for `option_payload` before LowerIntrinsics
+ // MIR for `option_payload` after LowerIntrinsics
fn option_payload(_1: &Option<usize>, _2: &Option<String>) -> () {
2023-06-06 08:47:00 -05:00
debug o => _1;
debug p => _2;
let mut _0: ();
let mut _4: *const std::option::Option<usize>;
let mut _6: *const std::option::Option<std::string::String>;
2023-03-15 10:29:52 -05:00
scope 1 {
2023-06-06 08:47:00 -05:00
let _3: *const usize;
2023-03-15 10:29:52 -05:00
scope 2 {
2023-06-06 08:47:00 -05:00
debug _x => _3;
let _5: *const std::string::String;
2023-03-15 10:29:52 -05:00
scope 3 {
2023-06-06 08:47:00 -05:00
debug _y => _5;
2023-03-15 10:29:52 -05:00
}
}
}
bb0: {
2023-06-06 08:47:00 -05:00
StorageLive(_3);
StorageLive(_4);
_4 = &raw const (*_1);
- _3 = option_payload_ptr::<usize>(move _4) -> [return: bb1, unwind unreachable];
+ _3 = &raw const (((*_4) as Some).0: usize);
+ goto -> bb1;
2023-03-15 10:29:52 -05:00
}
bb1: {
2023-06-06 08:47:00 -05:00
StorageDead(_4);
StorageLive(_5);
StorageLive(_6);
_6 = &raw const (*_2);
- _5 = option_payload_ptr::<String>(move _6) -> [return: bb2, unwind unreachable];
+ _5 = &raw const (((*_6) as Some).0: std::string::String);
+ goto -> bb2;
2023-03-15 10:29:52 -05:00
}
bb2: {
2023-06-06 08:47:00 -05:00
StorageDead(_6);
_0 = const ();
StorageDead(_5);
StorageDead(_3);
return;
2023-03-15 10:29:52 -05:00
}
}