2020-04-02 16:09:01 -05:00
|
|
|
// MIR for `main` before ElaborateDrops
|
|
|
|
|
|
|
|
fn main() -> () {
|
2022-07-27 13:47:42 -05:00
|
|
|
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:+0:11: +0:11
|
|
|
|
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+1:9: +1:10
|
2023-02-27 07:07:44 -06:00
|
|
|
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
let _6: (); // in scope 0 at $DIR/box_expr.rs:+3:5: +3:12
|
|
|
|
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:+3:10: +3:11
|
2020-04-02 16:09:01 -05:00
|
|
|
scope 1 {
|
2022-07-27 13:47:42 -05:00
|
|
|
debug x => _1; // in scope 1 at $DIR/box_expr.rs:+1:9: +1:10
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
2021-09-16 17:04:02 -05:00
|
|
|
scope 2 {
|
|
|
|
}
|
2020-04-02 16:09:01 -05:00
|
|
|
|
|
|
|
bb0: {
|
2022-07-27 13:47:42 -05:00
|
|
|
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:+1:9: +1:10
|
2023-02-27 07:07:44 -06:00
|
|
|
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:+2:5: +2:23
|
2020-04-02 16:09:01 -05:00
|
|
|
// mir::Constant
|
2023-02-27 07:07:44 -06:00
|
|
|
// + span: $DIR/box_expr.rs:8:5: 8:23
|
2022-07-06 09:14:46 -05:00
|
|
|
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2020-10-02 15:11:24 -05:00
|
|
|
bb1: {
|
2023-02-27 07:07:44 -06:00
|
|
|
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:+2:14: +2:22
|
2021-09-16 17:04:02 -05:00
|
|
|
// mir::Constant
|
2023-02-27 07:07:44 -06:00
|
|
|
// + span: $DIR/box_expr.rs:8:14: 8:20
|
2022-07-06 09:14:46 -05:00
|
|
|
// + literal: Const { ty: fn() -> S {S::new}, val: Value(<ZST>) }
|
2021-01-21 21:38:58 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-02-27 07:07:44 -06:00
|
|
|
_1 = move _5; // scope 0 at $DIR/box_expr.rs:+2:5: +2:23
|
|
|
|
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
2021-09-16 17:04:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-02-27 07:07:44 -06:00
|
|
|
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
|
|
|
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
|
|
|
|
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
|
|
|
|
_7 = move _1; // scope 1 at $DIR/box_expr.rs:+3:10: +3:11
|
|
|
|
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:+3:5: +3:12
|
2020-04-02 16:09:01 -05:00
|
|
|
// mir::Constant
|
2023-02-27 07:07:44 -06:00
|
|
|
// + span: $DIR/box_expr.rs:9:5: 9:9
|
2022-07-06 09:14:46 -05:00
|
|
|
// + literal: Const { ty: fn(Box<S>) {std::mem::drop::<Box<S>>}, val: Value(<ZST>) }
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
|
2021-09-16 17:04:02 -05:00
|
|
|
bb4: {
|
2023-02-27 07:07:44 -06:00
|
|
|
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
|
|
|
|
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:+3:12: +3:13
|
|
|
|
_0 = const (); // scope 0 at $DIR/box_expr.rs:+0:11: +4:2
|
|
|
|
drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
2020-10-02 15:11:24 -05:00
|
|
|
}
|
|
|
|
|
2021-09-16 17:04:02 -05:00
|
|
|
bb5: {
|
2023-02-27 07:07:44 -06:00
|
|
|
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
|
|
|
return; // scope 0 at $DIR/box_expr.rs:+4:2: +4:2
|
2020-10-02 15:11:24 -05:00
|
|
|
}
|
|
|
|
|
2020-10-24 05:18:32 -05:00
|
|
|
bb6 (cleanup): {
|
2023-02-27 07:07:44 -06:00
|
|
|
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:+3:11: +3:12
|
2021-01-21 21:38:58 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb7 (cleanup): {
|
2023-02-27 07:07:44 -06:00
|
|
|
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:+4:1: +4:2
|
2021-01-21 21:44:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb8 (cleanup): {
|
2023-02-27 07:07:44 -06:00
|
|
|
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:+2:22: +2:23
|
2021-09-16 17:04:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb9 (cleanup): {
|
2023-02-27 07:07:44 -06:00
|
|
|
resume; // scope 0 at $DIR/box_expr.rs:+0:1: +4:2
|
2020-04-02 16:09:01 -05:00
|
|
|
}
|
|
|
|
}
|