1
Fork 0
rust/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

206 lines
15 KiB
Rust
Raw Normal View History

2023-05-16 12:24:38 +00:00
// MIR for `enumerated_loop` after PreCodegen
fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
debug slice => _1; // in scope 0 at $DIR/slice_iter.rs:+0:31: +0:36
debug f => _2; // in scope 0 at $DIR/slice_iter.rs:+0:47: +0:48
let mut _0: (); // return place in scope 0 at $DIR/slice_iter.rs:+0:70: +0:70
let mut _13: std::slice::Iter<'_, T>; // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:31
let mut _14: std::iter::Enumerate<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
let mut _15: std::iter::Enumerate<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
let mut _16: &mut std::iter::Enumerate<std::slice::Iter<'_, T>>; // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
let mut _17: std::option::Option<(usize, &T)>; // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
let mut _18: isize; // in scope 0 at $DIR/slice_iter.rs:+1:5: +3:6
let mut _21: &impl Fn(usize, &T); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:10
let mut _22: (usize, &T); // in scope 0 at $DIR/slice_iter.rs:+2:9: +2:16
let _23: (); // in scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
scope 1 {
debug iter => _15; // in scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
let _19: usize; // in scope 1 at $DIR/slice_iter.rs:+1:10: +1:11
let _20: &T; // in scope 1 at $DIR/slice_iter.rs:+1:13: +1:14
scope 2 {
debug i => _19; // in scope 2 at $DIR/slice_iter.rs:+1:10: +1:11
debug x => _20; // in scope 2 at $DIR/slice_iter.rs:+1:13: +1:14
}
}
scope 3 (inlined core::slice::<impl [T]>::iter) { // at $DIR/slice_iter.rs:43:25: 43:31
2023-05-16 12:24:38 +00:00
debug self => _1; // in scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
scope 4 (inlined std::slice::Iter::<'_, T>::new) { // at $SRC_DIR/core/src/slice/mod.rs:LL:COL
debug slice => _1; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let _4: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _5: bool; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _6: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _8: usize; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _9: *mut T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _11: std::ptr::NonNull<T>; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
let mut _12: *const T; // in scope 4 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
scope 5 {
debug ptr => _4; // in scope 5 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
scope 6 {
let _7: *const T; // in scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
scope 7 {
debug end => _7; // in scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
scope 13 (inlined NonNull::<T>::new_unchecked) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
debug ptr => _9; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
let mut _10: *const T; // in scope 13 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
2023-06-01 06:08:25 +00:00
debug ptr => _9; // in scope 15 at $SRC_DIR/core/src/intrinsics.rs:LL:COL
2023-05-16 12:24:38 +00:00
scope 16 (inlined ptr::mut_ptr::<impl *mut T>::is_null) { // at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
2023-06-01 06:08:25 +00:00
debug self => _9; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
let mut _24: *mut u8; // in scope 16 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-05-16 12:24:38 +00:00
scope 17 {
scope 18 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-06-01 06:08:25 +00:00
debug ptr => _24; // in scope 18 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-05-16 12:24:38 +00:00
scope 19 (inlined ptr::mut_ptr::<impl *mut u8>::addr) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-06-01 06:08:25 +00:00
debug self => _24; // in scope 19 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-05-16 12:24:38 +00:00
scope 20 {
scope 21 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) { // at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-06-01 06:08:25 +00:00
debug self => _24; // in scope 21 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
2023-05-16 12:24:38 +00:00
}
}
}
}
}
}
}
}
}
}
scope 9 (inlined invalid::<T>) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
debug addr => _8; // in scope 9 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
scope 10 {
}
}
scope 11 (inlined ptr::const_ptr::<impl *const T>::add) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
debug self => _4; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
debug count => _6; // in scope 11 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
scope 12 {
}
}
}
}
scope 8 (inlined core::slice::<impl [T]>::as_ptr) { // at $SRC_DIR/core/src/slice/iter.rs:LL:COL
debug self => _1; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
let mut _3: *const [T]; // in scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
}
}
}
scope 22 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) { // at $DIR/slice_iter.rs:43:32: 43:43
2023-05-16 12:24:38 +00:00
debug self => _13; // in scope 22 at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
scope 23 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) { // at $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
debug iter => _13; // in scope 23 at $SRC_DIR/core/src/iter/adapters/enumerate.rs:LL:COL
}
}
scope 24 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) { // at $DIR/slice_iter.rs:43:19: 43:43
2023-05-16 12:24:38 +00:00
debug self => _14; // in scope 24 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
}
bb0: {
StorageLive(_13); // scope 0 at $DIR/slice_iter.rs:+1:19: +1:31
StorageLive(_4); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_3); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
_3 = &raw const (*_1); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
_4 = move _3 as *const T (PtrToPtr); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageDead(_3); // scope 8 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
StorageLive(_7); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_5); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_5 = const _; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
switchInt(move _5) -> [0: bb1, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
}
bb1: {
StorageLive(_6); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_6 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_7 = Offset(_4, _6); // scope 12 at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
StorageDead(_6); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
goto -> bb3; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
}
bb2: {
StorageLive(_8); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_8 = Len((*_1)); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_7 = _8 as *const T (Transmute); // scope 10 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
StorageDead(_8); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
goto -> bb3; // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
}
bb3: {
StorageDead(_5); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_11); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_9); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_9 = _4 as *mut T (PtrToPtr); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_10); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_24); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_10 = _9 as *const T (Pointer(MutToConstPointer)); // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
_11 = NonNull::<T> { pointer: _10 }; // scope 14 at $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
StorageDead(_24); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageDead(_10); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageDead(_9); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageLive(_12); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_12 = _7; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
_13 = std::slice::Iter::<'_, T> { ptr: move _11, end: move _12, _marker: const ZeroSized: PhantomData<&T> }; // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
// mir::Constant
// + span: no-location
// + literal: Const { ty: PhantomData<&T>, val: Value(<ZST>) }
// adt
// + user_ty: UserType(1)
StorageDead(_12); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageDead(_11); // scope 7 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageDead(_7); // scope 6 at $SRC_DIR/core/src/slice/iter.rs:LL:COL
StorageDead(_4); // scope 3 at $SRC_DIR/core/src/slice/mod.rs:LL:COL
_14 = Enumerate::<std::slice::Iter<'_, T>> { iter: move _13, count: const 0_usize }; // scope 23 at $SRC_DIR/core/src/iter/adapters/enumerate.rs:LL:COL
StorageDead(_13); // scope 0 at $DIR/slice_iter.rs:+1:42: +1:43
StorageLive(_15); // scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
_15 = move _14; // scope 0 at $DIR/slice_iter.rs:+1:19: +1:43
goto -> bb4; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
}
bb4: {
StorageLive(_17); // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
_16 = &mut _15; // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
_17 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(_16) -> [return: bb5, unwind unreachable]; // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
2023-05-16 12:24:38 +00:00
// mir::Constant
// + span: $DIR/slice_iter.rs:43:19: 43:43
2023-05-16 12:24:38 +00:00
// + literal: Const { ty: for<'a> fn(&'a mut Enumerate<std::slice::Iter<'_, T>>) -> Option<<Enumerate<std::slice::Iter<'_, T>> as Iterator>::Item> {<Enumerate<std::slice::Iter<'_, T>> as Iterator>::next}, val: Value(<ZST>) }
}
bb5: {
_18 = discriminant(_17); // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb10]; // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
}
bb6: {
StorageDead(_17); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
StorageDead(_15); // scope 0 at $DIR/slice_iter.rs:+3:5: +3:6
drop(_2) -> [return: bb7, unwind unreachable]; // scope 0 at $DIR/slice_iter.rs:+4:1: +4:2
2023-05-16 12:24:38 +00:00
}
bb7: {
return; // scope 0 at $DIR/slice_iter.rs:+4:2: +4:2
}
bb8: {
_19 = (((_17 as Some).0: (usize, &T)).0: usize); // scope 1 at $DIR/slice_iter.rs:+1:10: +1:11
_20 = (((_17 as Some).0: (usize, &T)).1: &T); // scope 1 at $DIR/slice_iter.rs:+1:13: +1:14
StorageLive(_21); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
_21 = &_2; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:10
StorageLive(_22); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:16
_22 = (_19, _20); // scope 2 at $DIR/slice_iter.rs:+2:9: +2:16
_23 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _21, move _22) -> [return: bb9, unwind unreachable]; // scope 2 at $DIR/slice_iter.rs:+2:9: +2:16
2023-05-16 12:24:38 +00:00
// mir::Constant
// + span: $DIR/slice_iter.rs:44:9: 44:10
2023-05-16 12:24:38 +00:00
// + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(usize, &T), (usize, &T)) -> <impl Fn(usize, &T) as FnOnce<(usize, &T)>>::Output {<impl Fn(usize, &T) as Fn<(usize, &T)>>::call}, val: Value(<ZST>) }
}
bb9: {
StorageDead(_22); // scope 2 at $DIR/slice_iter.rs:+2:15: +2:16
StorageDead(_21); // scope 2 at $DIR/slice_iter.rs:+2:15: +2:16
StorageDead(_17); // scope 1 at $DIR/slice_iter.rs:+3:5: +3:6
goto -> bb4; // scope 1 at $DIR/slice_iter.rs:+1:5: +3:6
}
bb10: {
unreachable; // scope 1 at $DIR/slice_iter.rs:+1:19: +1:43
}
}