fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `main` before Inline 2+ // MIR for `main` after Inline 3 4 fn main() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11 6 let _1: std::boxed::Box<std::vec::Vec<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 7 let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 8 let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 9+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 10 scope 1 { 11 debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11 12 } 13+ scope 2 { 14+ } 15 16 bb0: { 17 StorageLive(_1); // bb0[0]: scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 18 StorageLive(_2); // bb0[1]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 19 _2 = Box(std::vec::Vec<u32>); // bb0[2]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 20- (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 21+ _4 = &mut (*_2); // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 22+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL 23 // ty::Const 24- // + ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new} 25- // + val: Value(Scalar(<ZST>)) 26+ // + ty: alloc::raw_vec::RawVec<u32> 27+ // + 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: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) 28 // mir::Constant 29- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41 30- // + user_ty: UserType(1) 31- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) } 32- } 33- 34- bb1 (cleanup): { 35- resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 36- } 37- 38- bb2: { 39- _1 = move _2; // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 40- StorageDead(_2); // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 41- _0 = const (); // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 42+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL 43+ // + user_ty: UserType(0) 44+ // + 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: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } 45+ ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL 46 // ty::Const 47+ // + ty: usize 48+ // + val: Value(Scalar(0x0000000000000000)) 49+ // mir::Constant 50+ // + span: $SRC_DIR/liballoc/vec.rs:LL:COL 51+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) } 52+ _1 = move _2; // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 53+ StorageDead(_2); // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 54+ _0 = const (); // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 55+ // ty::Const 56 // + ty: () 57 // + val: Value(Scalar(<ZST>)) 58 // mir::Constant 59 // + span: $DIR/inline-into-box-place.rs:7:11: 9:2 60 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 61- drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 62+ drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 63 } 64 65- bb3: { 66- StorageDead(_1); // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 67- return; // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 68+ bb1 (cleanup): { 69+ resume; // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 70 } 71 72- bb4 (cleanup): { 73- _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 74- // ty::Const 75- // + ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>} 76- // + val: Value(Scalar(<ZST>)) 77- // mir::Constant 78- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43 79- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) } 80+ bb2: { 81+ StorageDead(_1); // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 82+ return; // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 83 } 84 } 85