2023-03-05 12:13:43 -06:00
|
|
|
- // MIR for `foo` before ScalarReplacementOfAggregates
|
|
|
|
+ // MIR for `foo` after ScalarReplacementOfAggregates
|
|
|
|
|
|
|
|
fn foo() -> () {
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _0: ();
|
|
|
|
let _1: Foo<T>;
|
|
|
|
let mut _2: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
|
|
|
|
let mut _3: std::boxed::Box<dyn std::fmt::Display>;
|
|
|
|
let mut _4: std::boxed::Box<u32>;
|
|
|
|
let mut _7: isize;
|
|
|
|
let _9: ();
|
|
|
|
let _10: ();
|
|
|
|
let mut _11: std::fmt::Arguments<'_>;
|
2024-05-24 15:14:40 -05:00
|
|
|
let mut _12: &[&str; 3];
|
|
|
|
let _13: &[&str; 3];
|
|
|
|
let _14: [&str; 3];
|
|
|
|
let mut _15: &[core::fmt::rt::Argument<'_>; 2];
|
|
|
|
let _16: &[core::fmt::rt::Argument<'_>; 2];
|
|
|
|
let _17: [core::fmt::rt::Argument<'_>; 2];
|
|
|
|
let mut _18: core::fmt::rt::Argument<'_>;
|
|
|
|
let mut _19: &std::boxed::Box<dyn std::fmt::Display>;
|
|
|
|
let _20: &std::boxed::Box<dyn std::fmt::Display>;
|
|
|
|
let mut _21: core::fmt::rt::Argument<'_>;
|
|
|
|
let mut _22: &u32;
|
|
|
|
let _23: &u32;
|
|
|
|
let mut _25: bool;
|
|
|
|
let mut _26: isize;
|
|
|
|
let mut _27: isize;
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _28: isize;
|
2024-05-24 15:14:40 -05:00
|
|
|
+ let _29: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
|
|
|
|
+ let _30: u32;
|
2023-03-05 12:13:43 -06:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
- debug foo => _1;
|
2024-05-24 15:14:40 -05:00
|
|
|
+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _29;
|
|
|
|
+ debug ((foo: Foo<T>).1: u32) => _30;
|
2023-06-06 08:47:00 -05:00
|
|
|
let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
|
2023-03-05 12:13:43 -06:00
|
|
|
scope 2 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _5;
|
|
|
|
let _6: u32;
|
2023-03-05 12:13:43 -06:00
|
|
|
scope 3 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug y => _6;
|
2023-03-05 12:13:43 -06:00
|
|
|
scope 4 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _8;
|
|
|
|
let _8: std::boxed::Box<dyn std::fmt::Display>;
|
2024-05-24 15:14:40 -05:00
|
|
|
let mut _24: &[&str; 3];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2024-05-24 15:14:40 -05:00
|
|
|
_25 = const false;
|
2023-06-06 08:47:00 -05:00
|
|
|
- StorageLive(_1);
|
2024-05-24 15:14:40 -05:00
|
|
|
+ StorageLive(_29);
|
|
|
|
+ StorageLive(_30);
|
2023-06-06 08:47:00 -05:00
|
|
|
+ nop;
|
|
|
|
StorageLive(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
_4 = Box::<u32>::new(const 5_u32) -> [return: bb1, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2024-09-15 12:35:06 -05:00
|
|
|
_3 = move _4 as std::boxed::Box<dyn std::fmt::Display> (PointerCoercion(Unsize, Implicit));
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_4);
|
|
|
|
_2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
|
|
|
|
StorageDead(_3);
|
|
|
|
- _1 = Foo::<T> { x: move _2, y: const 7_u32 };
|
2024-05-24 15:14:40 -05:00
|
|
|
+ _29 = move _2;
|
|
|
|
+ _30 = const 7_u32;
|
2023-06-06 08:47:00 -05:00
|
|
|
+ nop;
|
|
|
|
StorageDead(_2);
|
|
|
|
StorageLive(_5);
|
2024-05-24 15:14:40 -05:00
|
|
|
_25 = const true;
|
2023-06-06 08:47:00 -05:00
|
|
|
- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
|
2024-05-24 15:14:40 -05:00
|
|
|
+ _5 = move _29;
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_6);
|
|
|
|
- _6 = copy (_1.1: u32);
|
2024-05-24 15:14:40 -05:00
|
|
|
+ _6 = copy _30;
|
2023-06-06 08:47:00 -05:00
|
|
|
_7 = discriminant(_5);
|
|
|
|
switchInt(move _7) -> [0: bb2, otherwise: bb7];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_8);
|
2024-05-24 15:14:40 -05:00
|
|
|
_25 = const false;
|
2023-06-06 08:47:00 -05:00
|
|
|
_8 = move ((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>);
|
|
|
|
StorageLive(_9);
|
|
|
|
StorageLive(_10);
|
|
|
|
StorageLive(_11);
|
|
|
|
StorageLive(_12);
|
|
|
|
StorageLive(_13);
|
2024-05-24 15:14:40 -05:00
|
|
|
_24 = const foo::<T>::promoted[0];
|
|
|
|
_13 = &(*_24);
|
|
|
|
_12 = &(*_13);
|
|
|
|
StorageLive(_15);
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_16);
|
|
|
|
StorageLive(_17);
|
|
|
|
StorageLive(_18);
|
|
|
|
StorageLive(_19);
|
|
|
|
StorageLive(_20);
|
2024-05-24 15:14:40 -05:00
|
|
|
_20 = &_8;
|
|
|
|
_19 = &(*_20);
|
|
|
|
_18 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _19) -> [return: bb3, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2024-05-24 15:14:40 -05:00
|
|
|
StorageDead(_19);
|
|
|
|
StorageLive(_21);
|
|
|
|
StorageLive(_22);
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_23);
|
2024-05-24 15:14:40 -05:00
|
|
|
_23 = &_6;
|
|
|
|
_22 = &(*_23);
|
|
|
|
_21 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _22) -> [return: bb4, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2024-05-24 15:14:40 -05:00
|
|
|
StorageDead(_22);
|
|
|
|
_17 = [move _18, move _21];
|
|
|
|
StorageDead(_21);
|
|
|
|
StorageDead(_18);
|
|
|
|
_16 = &_17;
|
|
|
|
_15 = &(*_16);
|
|
|
|
_11 = Arguments::<'_>::new_v1::<3, 2>(move _12, move _15) -> [return: bb5, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb5: {
|
2024-05-24 15:14:40 -05:00
|
|
|
StorageDead(_15);
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_12);
|
|
|
|
_10 = _eprint(move _11) -> [return: bb6, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb6: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_11);
|
2024-05-24 15:14:40 -05:00
|
|
|
StorageDead(_23);
|
|
|
|
StorageDead(_20);
|
|
|
|
StorageDead(_17);
|
|
|
|
StorageDead(_16);
|
|
|
|
StorageDead(_13);
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_10);
|
|
|
|
_9 = const ();
|
|
|
|
StorageDead(_9);
|
|
|
|
_0 = const ();
|
|
|
|
drop(_8) -> [return: bb8, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb7: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = const ();
|
|
|
|
goto -> bb9;
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb8: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_8);
|
|
|
|
goto -> bb9;
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb9: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_6);
|
2024-05-24 15:14:40 -05:00
|
|
|
_26 = discriminant(_5);
|
|
|
|
switchInt(move _26) -> [0: bb11, otherwise: bb13];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb10: {
|
2024-05-24 15:14:40 -05:00
|
|
|
_25 = const false;
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_5);
|
|
|
|
- StorageDead(_1);
|
2024-05-24 15:14:40 -05:00
|
|
|
+ StorageDead(_29);
|
|
|
|
+ StorageDead(_30);
|
2023-06-06 08:47:00 -05:00
|
|
|
+ nop;
|
|
|
|
return;
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb11: {
|
2024-05-24 15:14:40 -05:00
|
|
|
switchInt(copy _25) -> [0: bb10, otherwise: bb12];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb12: {
|
2023-06-06 08:47:00 -05:00
|
|
|
drop(((_5 as Ok).0: std::boxed::Box<dyn std::fmt::Display>)) -> [return: bb10, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb13: {
|
2023-06-06 08:47:00 -05:00
|
|
|
drop(_5) -> [return: bb10, unwind unreachable];
|
2023-03-05 12:13:43 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|