| // MIR for `vec_move` after runtime-optimized | |
| fn vec_move(_1: Vec<impl Sized>) -> () { | |
| debug v => _1; | |
| let mut _0: (); | |
| let mut _21: std::vec::IntoIter<impl Sized>; | |
| let mut _22: std::vec::IntoIter<impl Sized>; | |
| let mut _23: &mut std::vec::IntoIter<impl Sized>; | |
| let mut _24: std::option::Option<impl Sized>; | |
| let mut _25: isize; | |
| let _27: (); | |
| scope 1 { | |
| debug iter => _22; | |
| let _26: impl Sized; | |
| scope 2 { | |
| debug x => _26; | |
| } | |
| } | |
| scope 3 (inlined <Vec<impl Sized> as IntoIterator>::into_iter) { | |
| debug self => _1; | |
| let _2: std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| let mut _3: *const std::alloc::Global; | |
| let mut _7: usize; | |
| let mut _9: *mut impl Sized; | |
| let mut _10: *const impl Sized; | |
| let mut _11: usize; | |
| let _28: &std::vec::Vec<impl Sized>; | |
| let mut _29: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| let mut _30: &alloc::raw_vec::RawVec<impl Sized>; | |
| let mut _31: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| let _32: &std::vec::Vec<impl Sized>; | |
| let mut _33: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| let _34: &std::vec::Vec<impl Sized>; | |
| let mut _35: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| let mut _36: &alloc::raw_vec::RawVec<impl Sized>; | |
| let mut _37: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>; | |
| scope 4 { | |
| debug me => _2; | |
| scope 5 { | |
| debug alloc => const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }}; | |
| let _5: std::ptr::NonNull<impl Sized>; | |
| scope 6 { | |
| debug buf => _5; | |
| let _6: *mut impl Sized; | |
| scope 7 { | |
| debug begin => _6; | |
| scope 8 { | |
| debug end => _10; | |
| let _19: usize; | |
| scope 9 { | |
| debug cap => _19; | |
| } | |
| scope 37 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) { | |
| debug self => _37; | |
| } | |
| scope 38 (inlined alloc::raw_vec::RawVec::<impl Sized>::capacity) { | |
| debug self => _36; | |
| let mut _38: &alloc::raw_vec::RawVecInner; | |
| scope 39 (inlined std::mem::size_of::<impl Sized>) { | |
| } | |
| scope 40 (inlined alloc::raw_vec::RawVecInner::capacity) { | |
| debug self => _38; | |
| debug elem_size => const <impl Sized as std::mem::SizedTypeProperties>::SIZE; | |
| let mut _20: core::num::niche_types::UsizeNoHighBit; | |
| scope 41 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) { | |
| debug self => _20; | |
| } | |
| } | |
| } | |
| } | |
| scope 23 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) { | |
| debug self => _33; | |
| } | |
| scope 24 (inlined Vec::<impl Sized>::len) { | |
| debug self => _32; | |
| let mut _12: bool; | |
| scope 25 { | |
| } | |
| } | |
| scope 26 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::wrapping_byte_add) { | |
| debug self => _6; | |
| debug count => _11; | |
| let mut _13: *mut u8; | |
| let mut _17: *mut u8; | |
| let mut _18: *const impl Sized; | |
| scope 27 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::cast::<u8>) { | |
| debug self => _6; | |
| } | |
| scope 28 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_add) { | |
| debug self => _13; | |
| debug count => _11; | |
| let mut _14: isize; | |
| scope 29 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_offset) { | |
| debug self => _13; | |
| debug count => _14; | |
| let mut _15: *const u8; | |
| let mut _16: *const u8; | |
| } | |
| } | |
| scope 30 (inlined std::ptr::mut_ptr::<impl *mut u8>::with_metadata_of::<impl Sized>) { | |
| debug self => _17; | |
| debug meta => _18; | |
| scope 31 (inlined std::ptr::metadata::<impl Sized>) { | |
| debug ptr => _18; | |
| } | |
| scope 32 (inlined std::ptr::from_raw_parts_mut::<impl Sized, ()>) { | |
| } | |
| } | |
| } | |
| scope 33 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) { | |
| debug self => _35; | |
| } | |
| scope 34 (inlined Vec::<impl Sized>::len) { | |
| debug self => _34; | |
| let mut _8: bool; | |
| scope 35 { | |
| } | |
| } | |
| scope 36 (inlined #[track_caller] std::ptr::mut_ptr::<impl *mut impl Sized>::add) { | |
| debug self => _6; | |
| debug count => _7; | |
| } | |
| } | |
| scope 22 (inlined NonNull::<impl Sized>::as_ptr) { | |
| debug self => _5; | |
| } | |
| } | |
| scope 17 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) { | |
| debug self => _31; | |
| } | |
| scope 18 (inlined alloc::raw_vec::RawVec::<impl Sized>::non_null) { | |
| debug self => _30; | |
| scope 19 (inlined alloc::raw_vec::RawVecInner::non_null::<impl Sized>) { | |
| let mut _4: std::ptr::NonNull<u8>; | |
| scope 20 (inlined NonNull::<u8>::cast::<impl Sized>) { | |
| scope 21 (inlined NonNull::<u8>::as_ptr) { | |
| } | |
| } | |
| } | |
| } | |
| } | |
| scope 11 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) { | |
| debug self => _29; | |
| } | |
| scope 12 (inlined Vec::<impl Sized>::allocator) { | |
| debug self => _28; | |
| scope 13 (inlined alloc::raw_vec::RawVec::<impl Sized>::allocator) { | |
| scope 14 (inlined alloc::raw_vec::RawVecInner::allocator) { | |
| } | |
| } | |
| } | |
| scope 15 (inlined #[track_caller] std::ptr::read::<std::alloc::Global>) { | |
| debug src => _3; | |
| } | |
| scope 16 (inlined ManuallyDrop::<std::alloc::Global>::new) { | |
| debug value => const std::alloc::Global; | |
| } | |
| } | |
| scope 10 (inlined ManuallyDrop::<Vec<impl Sized>>::new) { | |
| debug value => _1; | |
| } | |
| } | |
| bb0: { | |
| StorageLive(_21); | |
| StorageLive(_10); | |
| StorageLive(_19); | |
| StorageLive(_4); | |
| StorageLive(_16); | |
| StorageLive(_2); | |
| _2 = ManuallyDrop::<Vec<impl Sized>> { value: copy _1 }; | |
| StorageLive(_3); | |
| // DBG: _29 = &_2; | |
| // DBG: _28 = &(_2.0: std::vec::Vec<impl Sized>); | |
| _3 = &raw const ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global); | |
| StorageDead(_3); | |
| StorageLive(_5); | |
| // DBG: _31 = &_2; | |
| // DBG: _30 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>); | |
| _4 = copy ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).0: std::ptr::NonNull<u8>); | |
| _5 = copy _4 as std::ptr::NonNull<impl Sized> (Transmute); | |
| StorageLive(_6); | |
| _6 = copy _4 as *mut impl Sized (Transmute); | |
| switchInt(const <impl Sized as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; | |
| } | |
| bb1: { | |
| StorageLive(_9); | |
| StorageLive(_7); | |
| // DBG: _35 = &_2; | |
| // DBG: _34 = &(_2.0: std::vec::Vec<impl Sized>); | |
| _7 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize); | |
| StorageLive(_8); | |
| _8 = Le(copy _7, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN); | |
| assume(move _8); | |
| StorageDead(_8); | |
| _9 = Offset(copy _6, copy _7); | |
| _10 = copy _9 as *const impl Sized (PtrToPtr); | |
| StorageDead(_7); | |
| StorageDead(_9); | |
| goto -> bb4; | |
| } | |
| bb2: { | |
| StorageLive(_11); | |
| // DBG: _33 = &_2; | |
| // DBG: _32 = &(_2.0: std::vec::Vec<impl Sized>); | |
| _11 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize); | |
| StorageLive(_12); | |
| _12 = Le(copy _11, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN); | |
| assume(move _12); | |
| StorageDead(_12); | |
| StorageLive(_17); | |
| StorageLive(_13); | |
| _13 = copy _4 as *mut u8 (Transmute); | |
| StorageLive(_14); | |
| _14 = copy _11 as isize (IntToInt); | |
| StorageLive(_15); | |
| _15 = copy _4 as *const u8 (Transmute); | |
| _16 = arith_offset::<u8>(move _15, move _14) -> [return: bb3, unwind unreachable]; | |
| } | |
| bb3: { | |
| StorageDead(_15); | |
| _17 = copy _16 as *mut u8 (PtrToPtr); | |
| StorageDead(_14); | |
| StorageDead(_13); | |
| StorageLive(_18); | |
| _18 = copy _4 as *const impl Sized (Transmute); | |
| StorageDead(_18); | |
| StorageDead(_17); | |
| StorageDead(_11); | |
| _10 = copy _16 as *const impl Sized (PtrToPtr); | |
| goto -> bb4; | |
| } | |
| bb4: { | |
| // DBG: _37 = &_2; | |
| // DBG: _36 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>); | |
| // DBG: _38 = &(((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner); | |
| switchInt(const <impl Sized as std::mem::SizedTypeProperties>::SIZE) -> [0: bb5, otherwise: bb6]; | |
| } | |
| bb5: { | |
| _19 = const usize::MAX; | |
| goto -> bb7; | |
| } | |
| bb6: { | |
| StorageLive(_20); | |
| _20 = copy ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit); | |
| _19 = copy _20 as usize (Transmute); | |
| StorageDead(_20); | |
| goto -> bb7; | |
| } | |
| bb7: { | |
| _21 = std::vec::IntoIter::<impl Sized> { buf: copy _5, phantom: const ZeroSized: PhantomData<impl Sized>, cap: move _19, alloc: const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }}, ptr: copy _5, end: copy _10 }; | |
| StorageDead(_6); | |
| StorageDead(_5); | |
| StorageDead(_2); | |
| StorageDead(_16); | |
| StorageDead(_4); | |
| StorageDead(_19); | |
| StorageDead(_10); | |
| StorageLive(_22); | |
| _22 = move _21; | |
| goto -> bb8; | |
| } | |
| bb8: { | |
| StorageLive(_24); | |
| StorageLive(_23); | |
| _23 = &mut _22; | |
| _24 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _23) -> [return: bb9, unwind: bb15]; | |
| } | |
| bb9: { | |
| _25 = discriminant(_24); | |
| switchInt(move _25) -> [0: bb10, 1: bb12, otherwise: bb14]; | |
| } | |
| bb10: { | |
| StorageDead(_23); | |
| StorageDead(_24); | |
| drop(_22) -> [return: bb11, unwind continue]; | |
| } | |
| bb11: { | |
| StorageDead(_22); | |
| StorageDead(_21); | |
| return; | |
| } | |
| bb12: { | |
| StorageLive(_26); | |
| _26 = move ((_24 as Some).0: impl Sized); | |
| _27 = opaque::<impl Sized>(move _26) -> [return: bb13, unwind: bb15]; | |
| } | |
| bb13: { | |
| StorageDead(_26); | |
| StorageDead(_23); | |
| StorageDead(_24); | |
| goto -> bb8; | |
| } | |
| bb14: { | |
| unreachable; | |
| } | |
| bb15 (cleanup): { | |
| drop(_22) -> [return: bb16, unwind terminate(cleanup)]; | |
| } | |
| bb16 (cleanup): { | |
| resume; | |
| } | |
| } |