提交 ab645809 编写于 作者: G Gary Guo

Bless tests

上级 19eaee2c
......@@ -3,64 +3,78 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:6:11: 6:11
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
let mut _2: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _3: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _4: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _6: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
scope 1 {
debug x => _1; // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
}
scope 2 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
StorageLive(_2); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_2 = Box(S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:7:13: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:17: 7:23
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
// + span: $DIR/box_expr.rs:7:13: 7:25
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:17: 7:23
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
}
bb2: {
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
_1 = move _5; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb3: {
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_7 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// mir::Constant
// + span: $DIR/box_expr.rs:8:5: 8:9
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
}
bb3: {
StorageDead(_4); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_3); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
bb4: {
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
drop(_1) -> bb4; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb4: {
bb5: {
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}
bb5 (cleanup): {
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb6 (cleanup): {
drop(_1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb7 (cleanup): {
drop(_2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb8 (cleanup): {
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb9 (cleanup): {
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
}
......@@ -6,34 +6,51 @@
let _1: i32; // in scope 0 at $DIR/boxes.rs:12:9: 12:10
let mut _2: i32; // in scope 0 at $DIR/boxes.rs:12:13: 12:22
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _4: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _5: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
scope 1 {
debug x => _1; // in scope 1 at $DIR/boxes.rs:12:9: 12:10
}
scope 2 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/boxes.rs:12:9: 12:10
StorageLive(_2); // scope 0 at $DIR/boxes.rs:12:13: 12:22
StorageLive(_3); // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageLive(_4); // scope 0 at $DIR/boxes.rs:12:14: 12:22
_4 = Box(i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
(*_4) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
_3 = move _4; // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageDead(_4); // scope 0 at $DIR/boxes.rs:12:21: 12:22
- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
// mir::Constant
// + span: $DIR/boxes.rs:12:14: 12:22
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_7); // scope 0 at $DIR/boxes.rs:12:14: 12:22
_7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
(*_7) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
_3 = move _7; // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageDead(_7); // scope 0 at $DIR/boxes.rs:12:21: 12:22
_2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
drop(_3) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
drop(_3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
}
bb1: {
bb2: {
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
nop; // scope 0 at $DIR/boxes.rs:11:11: 13:2
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
}
bb2 (cleanup): {
bb3 (cleanup): {
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
}
}
......
......@@ -4,23 +4,37 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _7: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11
}
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
+ }
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
......@@ -30,32 +44,32 @@
- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
- bb2: {
+ // + span: $DIR/inline-into-box-place.rs:8:33: 8:43
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_4).1: usize) = const 0_usize; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ ((*_7).1: usize) = const 0_usize; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb2: {
+ bb1: {
- bb3: {
+ bb2: {
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
- bb3 (cleanup): {
+ bb2 (cleanup): {
- bb4 (cleanup): {
+ bb3 (cleanup): {
resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb4 (cleanup): {
- _3 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_2.1: std::alloc::Global)) -> bb3; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- bb5 (cleanup): {
- _6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<std::vec::Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
......
......@@ -4,23 +4,37 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _7: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11
}
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
+ }
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
......@@ -30,32 +44,32 @@
- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
- bb2: {
+ // + span: $DIR/inline-into-box-place.rs:8:33: 8:43
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_4).1: usize) = const 0_usize; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ ((*_7).1: usize) = const 0_usize; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
- drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb2: {
+ bb1: {
- bb3: {
+ bb2: {
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
- bb3 (cleanup): {
+ bb2 (cleanup): {
- bb4 (cleanup): {
+ bb3 (cleanup): {
resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb4 (cleanup): {
- _3 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_2.1: std::alloc::Global)) -> bb3; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- bb5 (cleanup): {
- _6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<std::vec::Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
......
......@@ -3,106 +3,120 @@
fn test() -> Option<Box<u32>> {
let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30
let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _3: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19
let mut _5: isize; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _6: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _7: !; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _8: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _9: u32; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _2: usize; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _3: usize; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _4: *mut u8; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _5: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19
let mut _8: isize; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _10: !; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _12: u32; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
scope 1 {
debug residual => _6; // in scope 1 at $DIR/issue-62289.rs:9:19: 9:20
scope 2 {
}
scope 2 {
debug residual => _9; // in scope 2 at $DIR/issue-62289.rs:9:19: 9:20
scope 3 {
}
}
scope 3 {
debug val => _9; // in scope 3 at $DIR/issue-62289.rs:9:15: 9:20
scope 4 {
scope 4 {
debug val => _12; // in scope 4 at $DIR/issue-62289.rs:9:15: 9:20
scope 5 {
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_2); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
_2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_4 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_3 = <Option<u32> as Try>::branch(move _4) -> [return: bb1, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_2 = SizeOf(u32); // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
_3 = AlignOf(u32); // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
// mir::Constant
// + span: $DIR/issue-62289.rs:9:15: 9:20
// + literal: Const { ty: fn(std::option::Option<u32>) -> std::ops::ControlFlow<<std::option::Option<u32> as std::ops::Try>::Residual, <std::option::Option<u32> as std::ops::Try>::Output> {<std::option::Option<u32> as std::ops::Try>::branch}, val: Value(Scalar(<ZST>)) }
// + span: $DIR/issue-62289.rs:9:10: 9:21
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_4); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_5 = discriminant(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_5); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
_5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_7); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_7 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:15: 9:20
// + literal: Const { ty: fn(std::option::Option<u32>) -> std::ops::ControlFlow<<std::option::Option<u32> as std::ops::Try>::Residual, <std::option::Option<u32> as std::ops::Try>::Output> {<std::option::Option<u32> as std::ops::Try>::branch}, val: Value(Scalar(<ZST>)) }
}
bb2: {
StorageLive(_9); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_9 = ((_3 as Continue).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
(*_2) = _9; // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
StorageDead(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_1 = move _2; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
drop(_2) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_7); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_8 = discriminant(_6); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
switchInt(move _8) -> [0_isize: bb3, 1_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
}
bb3: {
unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_12); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
(*_5) = _12; // scope 5 at $DIR/issue-62289.rs:9:15: 9:20
StorageDead(_12); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_1 = move _5; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb4: {
StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_6 = ((_3 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_8 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _8) -> [return: bb5, unwind: bb11]; // scope 2 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:19: 9:20
// + literal: Const { ty: fn(std::option::Option<std::convert::Infallible>) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::FromResidual<std::option::Option<std::convert::Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
}
bb5: {
StorageDead(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
drop(_2) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageLive(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
StorageLive(_11); // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
_11 = _9; // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
_0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:19: 9:20
// + literal: Const { ty: fn(std::option::Option<std::convert::Infallible>) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::FromResidual<std::option::Option<std::convert::Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
}
bb6: {
StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
_0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
drop(_1) -> bb7; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_11); // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
StorageDead(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
drop(_5) -> bb9; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb7: {
StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb9; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
StorageDead(_5); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
_0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
drop(_1) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
}
bb8: {
StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb9; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb9: {
return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
StorageDead(_5); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb10 (cleanup): {
drop(_1) -> bb12; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
bb10: {
return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb11 (cleanup): {
drop(_2) -> bb12; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
}
bb12 (cleanup): {
drop(_5) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb13 (cleanup): {
resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
}
}
......@@ -4,80 +4,108 @@ fn move_out_by_subslice() -> () {
let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:10:27: 10:27
let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _5: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
scope 1 {
debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:11:9: 11:10
let _6: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
scope 2 {
debug _y => _6; // in scope 2 at $DIR/uniform_array_move_out.rs:12:10: 12:17
let _12: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
scope 4 {
debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:12:10: 12:17
}
}
scope 2 {
}
scope 3 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:14: 11:19
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
(*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
}
bb2: {
StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:21: 11:26
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb3: {
StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
(*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
}
bb4: {
StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb5: {
StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb6: {
StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_6 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_12 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
drop(_6) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb5: {
StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_1) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
bb7: {
StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb6: {
bb8: {
StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
return; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
}
bb7 (cleanup): {
drop(_1) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
bb9 (cleanup): {
drop(_1) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb8 (cleanup): {
drop(_4) -> bb9; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
bb10 (cleanup): {
drop(_7) -> bb11; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb9 (cleanup): {
drop(_2) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
bb11 (cleanup): {
drop(_2) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb10 (cleanup): {
bb12 (cleanup): {
resume; // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
}
}
......@@ -4,80 +4,108 @@ fn move_out_from_end() -> () {
let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:4:24: 4:24
let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _5: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
scope 1 {
debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:5:9: 5:10
let _6: std::boxed::Box<i32>; // in scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
scope 2 {
debug _y => _6; // in scope 2 at $DIR/uniform_array_move_out.rs:6:14: 6:16
let _12: std::boxed::Box<i32>; // in scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
scope 4 {
debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:6:14: 6:16
}
}
scope 2 {
}
scope 3 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:14: 5:19
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
(*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
}
bb2: {
StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:21: 5:26
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb3: {
StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
(*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
}
bb4: {
StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb5: {
StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb6: {
StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
StorageLive(_6); // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_6 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_12 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
drop(_6) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb5: {
StorageDead(_6); // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_1) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
bb7: {
StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb6: {
bb8: {
StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
return; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
}
bb7 (cleanup): {
drop(_1) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
bb9 (cleanup): {
drop(_1) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb8 (cleanup): {
drop(_4) -> bb9; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
bb10 (cleanup): {
drop(_7) -> bb11; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb9 (cleanup): {
drop(_2) -> bb10; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
bb11 (cleanup): {
drop(_2) -> bb12; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb10 (cleanup): {
bb12 (cleanup): {
resume; // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
}
}
......@@ -9,5 +9,5 @@ fn main() {}
static TEST_BAD: &mut i32 = {
&mut *(box 0)
//~^ ERROR could not evaluate static initializer
//~| NOTE heap allocations
//~| NOTE calling non-const function `alloc::alloc::exchange_malloc`
};
......@@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/box.rs:10:11
|
LL | &mut *(box 0)
| ^^^^^^^ "heap allocations via `box` keyword" needs an rfc before being allowed inside constants
| ^^^^^^^ calling non-const function `alloc::alloc::exchange_malloc`
warning: skipping const checks
|
......
......@@ -4,7 +4,7 @@ error[E0597]: `tmp0` does not live long enough
LL | let tmp1 = &tmp0;
| ^^^^^ borrowed value does not live long enough
LL | box tmp1 as Box<dyn Foo + '_>
| ----------------------------- borrow later captured here by trait object
| ----------------------------- borrow later used here
LL | };
| - `tmp0` dropped here while still borrowed
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册