diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/mir-opt/pre-codegen | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/pre-codegen')
42 files changed, 385 insertions, 321 deletions
diff --git a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir index c7fd397fc..838e30fa3 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir @@ -7,130 +7,111 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { let mut _3: u32; let mut _4: u32; let mut _5: bool; - let mut _6: bool; + let mut _6: u32; let mut _7: u32; - let mut _8: u32; - let mut _9: bool; - let mut _10: bool; - let mut _11: u32; + let mut _8: bool; + let mut _9: u32; + let mut _10: u32; + let mut _11: bool; let mut _12: u32; - let mut _13: bool; + let mut _13: u32; let mut _14: bool; let mut _15: u32; let mut _16: u32; - let mut _17: bool; - let mut _18: u32; - let mut _19: u32; - let mut _20: bool; bb0: { - StorageLive(_14); - StorageLive(_10); - StorageLive(_6); StorageLive(_5); StorageLive(_3); _3 = ((*_1).0: u32); StorageLive(_4); _4 = ((*_2).0: u32); _5 = Eq(move _3, move _4); - StorageDead(_4); - StorageDead(_3); switchInt(move _5) -> [0: bb1, otherwise: bb2]; } bb1: { - _6 = const false; - goto -> bb3; + StorageDead(_4); + StorageDead(_3); + goto -> bb8; } bb2: { - StorageLive(_9); - StorageLive(_7); - _7 = ((*_1).1: u32); + StorageDead(_4); + StorageDead(_3); StorageLive(_8); - _8 = ((*_2).1: u32); - _9 = Eq(move _7, move _8); - StorageDead(_8); - StorageDead(_7); - _6 = move _9; - goto -> bb3; + StorageLive(_6); + _6 = ((*_1).1: u32); + StorageLive(_7); + _7 = ((*_2).1: u32); + _8 = Eq(move _6, move _7); + switchInt(move _8) -> [0: bb3, otherwise: bb4]; } bb3: { - StorageDead(_9); - StorageDead(_5); - switchInt(move _6) -> [0: bb4, otherwise: bb5]; + StorageDead(_7); + StorageDead(_6); + goto -> bb8; } bb4: { - _10 = const false; - goto -> bb6; + StorageDead(_7); + StorageDead(_6); + StorageLive(_11); + StorageLive(_9); + _9 = ((*_1).2: u32); + StorageLive(_10); + _10 = ((*_2).2: u32); + _11 = Eq(move _9, move _10); + switchInt(move _11) -> [0: bb5, otherwise: bb6]; } bb5: { - StorageLive(_13); - StorageLive(_11); - _11 = ((*_1).2: u32); - StorageLive(_12); - _12 = ((*_2).2: u32); - _13 = Eq(move _11, move _12); - StorageDead(_12); - StorageDead(_11); - _10 = move _13; - goto -> bb6; + StorageDead(_10); + StorageDead(_9); + goto -> bb8; } bb6: { - StorageDead(_13); - StorageDead(_6); - switchInt(move _10) -> [0: bb7, otherwise: bb8]; + StorageDead(_10); + StorageDead(_9); + StorageLive(_14); + StorageLive(_12); + _12 = ((*_1).3: u32); + StorageLive(_13); + _13 = ((*_2).3: u32); + _14 = Eq(move _12, move _13); + switchInt(move _14) -> [0: bb7, otherwise: bb9]; } bb7: { - _14 = const false; - goto -> bb9; + StorageDead(_13); + StorageDead(_12); + goto -> bb8; } bb8: { - StorageLive(_17); + _0 = const false; + goto -> bb10; + } + + bb9: { + StorageDead(_13); + StorageDead(_12); StorageLive(_15); - _15 = ((*_1).3: u32); + _15 = ((*_1).4: u32); StorageLive(_16); - _16 = ((*_2).3: u32); - _17 = Eq(move _15, move _16); + _16 = ((*_2).4: u32); + _0 = Eq(move _15, move _16); StorageDead(_16); StorageDead(_15); - _14 = move _17; - goto -> bb9; - } - - bb9: { - StorageDead(_17); - StorageDead(_10); - switchInt(move _14) -> [0: bb10, otherwise: bb11]; + goto -> bb10; } bb10: { - _0 = const false; - goto -> bb12; - } - - bb11: { - StorageLive(_20); - StorageLive(_18); - _18 = ((*_1).4: u32); - StorageLive(_19); - _19 = ((*_2).4: u32); - _20 = Eq(move _18, move _19); - StorageDead(_19); - StorageDead(_18); - _0 = move _20; - goto -> bb12; - } - - bb12: { - StorageDead(_20); StorageDead(_14); + StorageDead(_11); + StorageDead(_8); + StorageDead(_5); return; } } diff --git a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir index 1e619bc97..8452fa12f 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir @@ -27,12 +27,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_4); _4 = ((*_2).0: u32); _5 = Ne(move _3, move _4); - StorageDead(_4); - StorageDead(_3); switchInt(move _5) -> [0: bb1, otherwise: bb10]; } bb1: { + StorageDead(_4); + StorageDead(_3); StorageDead(_5); StorageLive(_8); StorageLive(_6); @@ -40,12 +40,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_7); _7 = ((*_2).1: u32); _8 = Ne(move _6, move _7); - StorageDead(_7); - StorageDead(_6); switchInt(move _8) -> [0: bb2, otherwise: bb9]; } bb2: { + StorageDead(_7); + StorageDead(_6); StorageDead(_8); StorageLive(_11); StorageLive(_9); @@ -53,12 +53,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_10); _10 = ((*_2).2: u32); _11 = Ne(move _9, move _10); - StorageDead(_10); - StorageDead(_9); switchInt(move _11) -> [0: bb3, otherwise: bb8]; } bb3: { + StorageDead(_10); + StorageDead(_9); StorageDead(_11); StorageLive(_14); StorageLive(_12); @@ -66,12 +66,12 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_13); _13 = ((*_2).3: u32); _14 = Ne(move _12, move _13); - StorageDead(_13); - StorageDead(_12); switchInt(move _14) -> [0: bb4, otherwise: bb7]; } bb4: { + StorageDead(_13); + StorageDead(_12); StorageDead(_14); StorageLive(_17); StorageLive(_15); @@ -79,42 +79,52 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_16); _16 = ((*_2).4: u32); _17 = Ne(move _15, move _16); - StorageDead(_16); - StorageDead(_15); switchInt(move _17) -> [0: bb5, otherwise: bb6]; } bb5: { + StorageDead(_16); + StorageDead(_15); StorageDead(_17); _0 = const true; goto -> bb11; } bb6: { + StorageDead(_16); + StorageDead(_15); _0 = const false; StorageDead(_17); goto -> bb11; } bb7: { + StorageDead(_13); + StorageDead(_12); _0 = const false; StorageDead(_14); goto -> bb11; } bb8: { + StorageDead(_10); + StorageDead(_9); _0 = const false; StorageDead(_11); goto -> bb11; } bb9: { + StorageDead(_7); + StorageDead(_6); _0 = const false; StorageDead(_8); goto -> bb11; } bb10: { + StorageDead(_4); + StorageDead(_3); _0 = const false; StorageDead(_5); goto -> bb11; diff --git a/tests/mir-opt/pre-codegen/chained_comparison.rs b/tests/mir-opt/pre-codegen/chained_comparison.rs index f7879140f..430300419 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.rs +++ b/tests/mir-opt/pre-codegen/chained_comparison.rs @@ -1,5 +1,4 @@ // compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 -// ignore-debug #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/checked_ops.rs b/tests/mir-opt/pre-codegen/checked_ops.rs index dee43b0c6..23d78e987 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.rs +++ b/tests/mir-opt/pre-codegen/checked_ops.rs @@ -1,6 +1,5 @@ // compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 // needs-unwind -// ignore-debug // only-x86_64 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir index b2ea96f03..75f81c5aa 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir @@ -40,16 +40,22 @@ fn step_forward(_1: u32, _2: usize) -> u32 { _5 = Eq(_4, const 1_isize); _6 = Not(move _5); StorageDead(_5); - StorageDead(_3); - StorageDead(_8); - switchInt(move _6) -> [0: bb3, otherwise: bb2]; + switchInt(move _6) -> [0: bb2, otherwise: bb3]; } bb2: { - assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb3, unwind continue]; + StorageDead(_3); + StorageDead(_8); + goto -> bb4; } bb3: { + StorageDead(_3); + StorageDead(_8); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb4, unwind continue]; + } + + bb4: { StorageDead(_6); StorageLive(_7); _7 = _2 as u32 (IntToInt); diff --git a/tests/mir-opt/pre-codegen/intrinsics.rs b/tests/mir-opt/pre-codegen/intrinsics.rs index ecdb656cb..e32e04384 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.rs +++ b/tests/mir-opt/pre-codegen/intrinsics.rs @@ -1,6 +1,5 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug // Checks that we do not have any branches in the MIR for the two tested functions. diff --git a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir index 940b9ae11..4db829a5e 100644 --- a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir @@ -83,7 +83,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> () } bb9 (cleanup): { - drop(_5) -> [return: bb10, unwind terminate]; + drop(_5) -> [return: bb10, unwind terminate(cleanup)]; } bb10 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir index 2e51faeba..0d79f2de1 100644 --- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir @@ -63,17 +63,19 @@ fn int_range(_1: usize, _2: usize) -> () { _7 = Lt(move _5, move _6); StorageDead(_6); StorageDead(_5); - StorageDead(_16); - StorageDead(_15); switchInt(move _7) -> [0: bb2, otherwise: bb3]; } bb2: { + StorageDead(_16); + StorageDead(_15); _8 = Option::<usize>::None; goto -> bb5; } bb3: { + StorageDead(_16); + StorageDead(_15); _9 = (_4.0: usize); StorageLive(_10); _10 = <usize as Step>::forward_unchecked(_9, const 1_usize) -> [return: bb4, unwind continue]; diff --git a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir index 261416036..c30df7425 100644 --- a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir @@ -75,7 +75,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () { } bb9 (cleanup): { - drop(_5) -> [return: bb10, unwind terminate]; + drop(_5) -> [return: bb10, unwind terminate(cleanup)]; } bb10 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs index 67f549a51..f3ba40922 100644 --- a/tests/mir-opt/pre-codegen/loops.rs +++ b/tests/mir-opt/pre-codegen/loops.rs @@ -1,6 +1,5 @@ // compile-flags: -O -Zmir-opt-level=2 -g // needs-unwind -// ignore-debug #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir index 8eff46fb9..cb29473d7 100644 --- a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir @@ -67,7 +67,7 @@ fn vec_move(_1: Vec<impl Sized>) -> () { } bb9 (cleanup): { - drop(_3) -> [return: bb10, unwind terminate]; + drop(_3) -> [return: bb10, unwind terminate(cleanup)]; } bb10 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir index 26919dd98..630babaa8 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.mir @@ -10,23 +10,53 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { scope 2 { scope 3 { debug result => _0; - scope 6 (inlined std::ptr::write::<u32>) { + scope 16 (inlined std::ptr::write::<u32>) { debug dst => _1; debug src => _2; - scope 7 { + scope 17 { } } } scope 4 (inlined std::ptr::read::<u32>) { debug src => _1; scope 5 { + scope 6 (inlined std::ptr::read::runtime::<u32>) { + debug src => _1; + scope 7 (inlined intrinsics::is_aligned_and_not_null::<u32>) { + debug ptr => _1; + scope 8 (inlined ptr::const_ptr::<impl *const u32>::is_null) { + debug self => _1; + let mut _3: *const u8; + scope 9 { + scope 10 (inlined ptr::const_ptr::<impl *const T>::is_null::runtime_impl) { + debug ptr => _3; + scope 11 (inlined ptr::const_ptr::<impl *const u8>::addr) { + debug self => _3; + scope 12 { + scope 13 (inlined ptr::const_ptr::<impl *const u8>::cast::<()>) { + debug self => _3; + } + } + } + } + } + } + scope 14 (inlined ptr::const_ptr::<impl *const u32>::is_aligned) { + debug self => _1; + scope 15 (inlined align_of::<u32>) { + } + } + } + } } } } } bb0: { + StorageLive(_3); _0 = (*_1); + StorageDead(_3); (*_1) = _2; return; } diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index e5066c38b..a139848ba 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,6 +1,6 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug +// ignore-debug the standard library debug assertions leak into this test #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff index 2c607b4c0..681e9666e 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-abort.diff @@ -55,5 +55,9 @@ StorageDead(_1); return; } ++ } ++ ++ alloc5 (size: 8, align: 4) { ++ 04 00 00 00 00 __ __ __ │ .....░░░ } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff index b6929f3f9..db16b8d82 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.32bit.panic-unwind.diff @@ -55,5 +55,9 @@ StorageDead(_1); return; } ++ } ++ ++ alloc5 (size: 8, align: 4) { ++ 04 00 00 00 00 __ __ __ │ .....░░░ } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff index 2c607b4c0..681e9666e 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-abort.diff @@ -55,5 +55,9 @@ StorageDead(_1); return; } ++ } ++ ++ alloc5 (size: 8, align: 4) { ++ 04 00 00 00 00 __ __ __ │ .....░░░ } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff index b6929f3f9..db16b8d82 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ConstProp.64bit.panic-unwind.diff @@ -55,5 +55,9 @@ StorageDead(_1); return; } ++ } ++ ++ alloc5 (size: 8, align: 4) { ++ 04 00 00 00 00 __ __ __ │ .....░░░ } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir index d76b46bdd..9664ccfb0 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -66,17 +66,19 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { _8 = Lt(move _6, move _7); StorageDead(_7); StorageDead(_6); - StorageDead(_19); - StorageDead(_18); switchInt(move _8) -> [0: bb2, otherwise: bb3]; } bb2: { + StorageDead(_19); + StorageDead(_18); _9 = Option::<u32>::None; goto -> bb5; } bb3: { + StorageDead(_19); + StorageDead(_18); _10 = (_5.0: u32); StorageLive(_11); _11 = <u32 as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable]; diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir index 4d7c017da..dc8b46b6c 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -66,17 +66,19 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { _8 = Lt(move _6, move _7); StorageDead(_7); StorageDead(_6); - StorageDead(_19); - StorageDead(_18); switchInt(move _8) -> [0: bb2, otherwise: bb3]; } bb2: { + StorageDead(_19); + StorageDead(_18); _9 = Option::<u32>::None; goto -> bb5; } bb3: { + StorageDead(_19); + StorageDead(_18); _10 = (_5.0: u32); StorageLive(_11); _11 = <u32 as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind: bb11]; @@ -127,7 +129,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb11 (cleanup): { - drop(_3) -> [return: bb12, unwind terminate]; + drop(_3) -> [return: bb12, unwind terminate(cleanup)]; } bb12 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir index bbab4e47a..a677e8b43 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir @@ -82,7 +82,7 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb8 (cleanup): { - drop(_3) -> [return: bb9, unwind terminate]; + drop(_3) -> [return: bb9, unwind terminate(cleanup)]; } bb9 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir index 7360aa3e6..fff713b5a 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir @@ -38,17 +38,19 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); - StorageDead(_8); - StorageDead(_7); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { + StorageDead(_8); + StorageDead(_7); _0 = Option::<u32>::None; goto -> bb4; } bb2: { + StorageDead(_8); + StorageDead(_7); _5 = ((*_1).0: u32); StorageLive(_6); _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind unreachable]; diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir index 61957082d..cc12c0122 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir @@ -38,17 +38,19 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); - StorageDead(_8); - StorageDead(_7); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { + StorageDead(_8); + StorageDead(_7); _0 = Option::<u32>::None; goto -> bb4; } bb2: { + StorageDead(_8); + StorageDead(_7); _5 = ((*_1).0: u32); StorageLive(_6); _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind continue]; diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs index cabd9419e..955214478 100644 --- a/tests/mir-opt/pre-codegen/range_iter.rs +++ b/tests/mir-opt/pre-codegen/range_iter.rs @@ -1,6 +1,5 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 68d78f743..48b780aea 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -3,9 +3,9 @@ fn ezmap(_1: Option<i32>) -> Option<i32> { debug x => _1; let mut _0: std::option::Option<i32>; - scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map.rs:18:12: 18:15]>) { + scope 1 (inlined map::<i32, i32, {closure@$DIR/simple_option_map.rs:17:12: 17:15}>) { debug slf => _1; - debug f => const ZeroSized: [closure@$DIR/simple_option_map.rs:18:12: 18:15]; + debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:17:12: 17:15}; let mut _2: isize; let _3: i32; let mut _4: i32; diff --git a/tests/mir-opt/pre-codegen/simple_option_map.rs b/tests/mir-opt/pre-codegen/simple_option_map.rs index fb3da68e4..d4f28dda6 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.rs +++ b/tests/mir-opt/pre-codegen/simple_option_map.rs @@ -1,6 +1,5 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug #[inline(always)] fn map<T, U, F>(slf: Option<T>, f: F) -> Option<U> diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir index 1488779f9..ed286beb4 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir @@ -1,6 +1,6 @@ // MIR for `variant_a::{closure#0}` after PreCodegen -fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2: &&(usize, usize, usize, usize)) -> bool { +fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2: &&(usize, usize, usize, usize)) -> bool { let mut _0: bool; let mut _3: &(usize, usize, usize, usize); let _4: &usize; @@ -12,30 +12,27 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2 let _10: &usize; let _11: &usize; let mut _16: bool; - let mut _17: bool; - let _18: &usize; - let mut _23: bool; - let _24: &usize; - let mut _29: bool; - let mut _30: bool; - let _31: &usize; - let mut _36: bool; + let _17: &usize; + let mut _22: bool; + let _23: &usize; + let mut _28: bool; + let _29: &usize; + let mut _34: &&usize; + let mut _35: &&usize; + let mut _36: &&usize; let mut _37: &&usize; let mut _38: &&usize; let mut _39: &&usize; let mut _40: &&usize; let mut _41: &&usize; - let mut _42: &&usize; - let mut _43: &&usize; - let mut _44: &&usize; scope 1 { debug a => _4; debug b => _6; debug c => _8; debug d => _10; scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _37; - debug other => _38; + debug self => _34; + debug other => _35; let mut _12: &usize; let mut _13: &usize; scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) { @@ -46,39 +43,39 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2 } } scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _41; - debug other => _42; - let mut _25: &usize; - let mut _26: &usize; + debug self => _36; + debug other => _37; + let mut _18: &usize; + let mut _19: &usize; scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _25; - debug other => _26; - let mut _27: usize; - let mut _28: usize; + debug self => _18; + debug other => _19; + let mut _20: usize; + let mut _21: usize; } } scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _39; - debug other => _40; - let mut _19: &usize; - let mut _20: &usize; + debug self => _38; + debug other => _39; + let mut _24: &usize; + let mut _25: &usize; scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _19; - debug other => _20; - let mut _21: usize; - let mut _22: usize; + debug self => _24; + debug other => _25; + let mut _26: usize; + let mut _27: usize; } } scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { - debug self => _43; - debug other => _44; - let mut _32: &usize; - let mut _33: &usize; + debug self => _40; + debug other => _41; + let mut _30: &usize; + let mut _31: &usize; scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) { - debug self => _32; - debug other => _33; - let mut _34: usize; - let mut _35: usize; + debug self => _30; + debug other => _31; + let mut _32: usize; + let mut _33: usize; } } } @@ -96,10 +93,9 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2 StorageLive(_10); _9 = deref_copy (*_2); _10 = &((*_9).3: usize); - StorageLive(_17); StorageLive(_16); - StorageLive(_37); - StorageLive(_38); + StorageLive(_34); + StorageLive(_35); StorageLive(_11); _11 = _8; _12 = deref_copy _4; @@ -111,109 +107,109 @@ fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:7:25: 7:39], _2 _16 = Le(move _14, move _15); StorageDead(_15); StorageDead(_14); - StorageDead(_11); - StorageDead(_38); - StorageDead(_37); switchInt(move _16) -> [0: bb1, otherwise: bb2]; } bb1: { - _17 = const false; - goto -> bb3; + StorageDead(_11); + StorageDead(_35); + StorageDead(_34); + goto -> bb4; } bb2: { - StorageLive(_23); - StorageLive(_39); - StorageLive(_40); - StorageLive(_18); - _18 = _6; - _19 = deref_copy _10; - _20 = deref_copy _18; + StorageDead(_11); + StorageDead(_35); + StorageDead(_34); + StorageLive(_22); + StorageLive(_36); + StorageLive(_37); + StorageLive(_17); + _17 = _6; + _18 = deref_copy _10; + _19 = deref_copy _17; + StorageLive(_20); + _20 = (*_18); StorageLive(_21); _21 = (*_19); - StorageLive(_22); - _22 = (*_20); - _23 = Le(move _21, move _22); - StorageDead(_22); + _22 = Le(move _20, move _21); StorageDead(_21); - StorageDead(_18); - StorageDead(_40); - StorageDead(_39); - _17 = move _23; - goto -> bb3; + StorageDead(_20); + switchInt(move _22) -> [0: bb3, otherwise: bb8]; } bb3: { - StorageDead(_23); - StorageDead(_16); - switchInt(move _17) -> [0: bb4, otherwise: bb8]; + StorageDead(_17); + StorageDead(_37); + StorageDead(_36); + goto -> bb4; } bb4: { - StorageLive(_30); - StorageLive(_29); - StorageLive(_41); - StorageLive(_42); - StorageLive(_24); - _24 = _4; - _25 = deref_copy _8; - _26 = deref_copy _24; + StorageLive(_28); + StorageLive(_38); + StorageLive(_39); + StorageLive(_23); + _23 = _4; + _24 = deref_copy _8; + _25 = deref_copy _23; + StorageLive(_26); + _26 = (*_24); StorageLive(_27); _27 = (*_25); - StorageLive(_28); - _28 = (*_26); - _29 = Le(move _27, move _28); - StorageDead(_28); + _28 = Le(move _26, move _27); StorageDead(_27); - StorageDead(_24); - StorageDead(_42); - StorageDead(_41); - switchInt(move _29) -> [0: bb5, otherwise: bb6]; + StorageDead(_26); + switchInt(move _28) -> [0: bb5, otherwise: bb6]; } bb5: { - _30 = const false; + StorageDead(_23); + StorageDead(_39); + StorageDead(_38); + _0 = const false; goto -> bb7; } bb6: { - StorageLive(_36); - StorageLive(_43); - StorageLive(_44); - StorageLive(_31); - _31 = _10; - _32 = deref_copy _6; - _33 = deref_copy _31; - StorageLive(_34); - _34 = (*_32); - StorageLive(_35); - _35 = (*_33); - _36 = Le(move _34, move _35); - StorageDead(_35); - StorageDead(_34); - StorageDead(_31); - StorageDead(_44); - StorageDead(_43); - _30 = move _36; + StorageDead(_23); + StorageDead(_39); + StorageDead(_38); + StorageLive(_40); + StorageLive(_41); + StorageLive(_29); + _29 = _10; + _30 = deref_copy _6; + _31 = deref_copy _29; + StorageLive(_32); + _32 = (*_30); + StorageLive(_33); + _33 = (*_31); + _0 = Le(move _32, move _33); + StorageDead(_33); + StorageDead(_32); + StorageDead(_29); + StorageDead(_41); + StorageDead(_40); goto -> bb7; } bb7: { - StorageDead(_36); - StorageDead(_29); - _0 = move _30; + StorageDead(_28); goto -> bb9; } bb8: { + StorageDead(_17); + StorageDead(_37); + StorageDead(_36); _0 = const true; goto -> bb9; } bb9: { - StorageDead(_30); - StorageDead(_17); + StorageDead(_22); + StorageDead(_16); StorageDead(_10); StorageDead(_8); StorageDead(_6); diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir index bab9f0b58..80c8cebff 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir @@ -1,6 +1,6 @@ // MIR for `variant_b::{closure#0}` after PreCodegen -fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41], _2: &&(usize, usize, usize, usize)) -> bool { +fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, _2: &&(usize, usize, usize, usize)) -> bool { let mut _0: bool; let mut _3: &(usize, usize, usize, usize); let _4: usize; @@ -13,9 +13,6 @@ fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41], let mut _11: bool; let mut _12: bool; let mut _13: bool; - let mut _14: bool; - let mut _15: bool; - let mut _16: bool; scope 1 { debug a => _4; debug b => _6; @@ -32,64 +29,46 @@ fn variant_b::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:11:25: 11:41], _8 = ((*_7).2: usize); _9 = deref_copy (*_2); _10 = ((*_9).3: usize); - StorageLive(_12); StorageLive(_11); _11 = Le(_4, _8); - switchInt(move _11) -> [0: bb1, otherwise: bb2]; + switchInt(move _11) -> [0: bb2, otherwise: bb1]; } bb1: { - _12 = const false; - goto -> bb3; + StorageLive(_12); + _12 = Le(_10, _6); + switchInt(move _12) -> [0: bb2, otherwise: bb6]; } bb2: { StorageLive(_13); - _13 = Le(_10, _6); - _12 = move _13; - goto -> bb3; + _13 = Le(_8, _4); + switchInt(move _13) -> [0: bb3, otherwise: bb4]; } bb3: { - StorageDead(_13); - StorageDead(_11); - switchInt(move _12) -> [0: bb4, otherwise: bb8]; + _0 = const false; + goto -> bb5; } bb4: { - StorageLive(_15); - StorageLive(_14); - _14 = Le(_8, _4); - switchInt(move _14) -> [0: bb5, otherwise: bb6]; + _0 = Le(_6, _10); + goto -> bb5; } bb5: { - _15 = const false; + StorageDead(_13); goto -> bb7; } bb6: { - StorageLive(_16); - _16 = Le(_6, _10); - _15 = move _16; + _0 = const true; goto -> bb7; } bb7: { - StorageDead(_16); - StorageDead(_14); - _0 = move _15; - goto -> bb9; - } - - bb8: { - _0 = const true; - goto -> bb9; - } - - bb9: { - StorageDead(_15); StorageDead(_12); + StorageDead(_11); return; } } diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index d80bff50c..57ffb07e2 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -1,6 +1,6 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug +// ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir index 07a58309e..8590c9d3b 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir @@ -58,16 +58,17 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_3); _3 = Len((*_1)); _4 = Lt(_2, move _3); - StorageDead(_3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { + StorageDead(_3); _0 = const Option::<&mut u32>::None; goto -> bb3; } bb2: { + StorageDead(_3); StorageLive(_8); StorageLive(_5); _5 = &raw mut (*_1); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir index 07a58309e..8590c9d3b 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir @@ -58,16 +58,17 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_3); _3 = Len((*_1)); _4 = Lt(_2, move _3); - StorageDead(_3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { + StorageDead(_3); _0 = const Option::<&mut u32>::None; goto -> bb3; } bb2: { + StorageDead(_3); StorageLive(_8); StorageLive(_5); _5 = &raw mut (*_1); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir index 2f5d356a2..2fd669aee 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir @@ -8,46 +8,63 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> let mut _4: usize; scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) { debug self => _1; - debug index => std::ops::Range<usize>{ .0 => _3, .1 => _4, }; + debug ((index: std::ops::Range<usize>).0: usize) => _3; + debug ((index: std::ops::Range<usize>).1: usize) => _4; let mut _5: *mut [u32]; let mut _13: *mut [u32]; scope 2 { scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) { - debug self => std::ops::Range<usize>{ .0 => _3, .1 => _4, }; + debug ((self: std::ops::Range<usize>).0: usize) => _3; + debug ((self: std::ops::Range<usize>).1: usize) => _4; debug slice => _5; let mut _7: *mut u32; let mut _8: *mut u32; - let _14: usize; let _15: usize; + let _16: usize; scope 4 { - debug this => std::ops::Range<usize>{ .0 => _14, .1 => _15, }; + debug ((this: std::ops::Range<usize>).0: usize) => _15; + debug ((this: std::ops::Range<usize>).1: usize) => _16; scope 5 { let _6: usize; scope 6 { debug new_len => _6; - scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { + scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { debug self => _5; } - scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) { + scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) { debug self => _7; debug count => _3; - scope 9 { + scope 13 { } } - scope 10 (inlined slice_from_raw_parts_mut::<u32>) { + scope 14 (inlined slice_from_raw_parts_mut::<u32>) { debug data => _8; debug len => _6; let mut _9: *mut (); - scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { + scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { debug self => _8; } - scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { + scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { debug data_address => _9; debug metadata => _6; let mut _10: *const (); let mut _11: std::ptr::metadata::PtrComponents<[u32]>; let mut _12: std::ptr::metadata::PtrRepr<[u32]>; - scope 13 { + scope 17 { + } + } + } + } + scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) { + debug ((this: std::ops::Range<usize>).0: usize) => _15; + debug ((this: std::ops::Range<usize>).1: usize) => _16; + debug slice => _5; + scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) { + debug self => _5; + let mut _14: *const [u32]; + scope 9 (inlined std::ptr::metadata::<[u32]>) { + debug ptr => _14; + scope 10 { } } } @@ -63,9 +80,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> _4 = move (_2.1: usize); StorageLive(_5); _5 = &raw mut (*_1); + StorageLive(_6); StorageLive(_14); StorageLive(_15); - StorageLive(_6); + StorageLive(_16); _6 = SubUnchecked(_4, _3); StorageLive(_8); StorageLive(_7); @@ -86,9 +104,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> StorageDead(_12); StorageDead(_9); StorageDead(_8); - StorageDead(_6); - StorageDead(_14); + StorageDead(_16); StorageDead(_15); + StorageDead(_14); + StorageDead(_6); StorageDead(_5); _0 = &mut (*_13); return; diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir index 2f5d356a2..2fd669aee 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir @@ -8,46 +8,63 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> let mut _4: usize; scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) { debug self => _1; - debug index => std::ops::Range<usize>{ .0 => _3, .1 => _4, }; + debug ((index: std::ops::Range<usize>).0: usize) => _3; + debug ((index: std::ops::Range<usize>).1: usize) => _4; let mut _5: *mut [u32]; let mut _13: *mut [u32]; scope 2 { scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) { - debug self => std::ops::Range<usize>{ .0 => _3, .1 => _4, }; + debug ((self: std::ops::Range<usize>).0: usize) => _3; + debug ((self: std::ops::Range<usize>).1: usize) => _4; debug slice => _5; let mut _7: *mut u32; let mut _8: *mut u32; - let _14: usize; let _15: usize; + let _16: usize; scope 4 { - debug this => std::ops::Range<usize>{ .0 => _14, .1 => _15, }; + debug ((this: std::ops::Range<usize>).0: usize) => _15; + debug ((this: std::ops::Range<usize>).1: usize) => _16; scope 5 { let _6: usize; scope 6 { debug new_len => _6; - scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { + scope 11 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) { debug self => _5; } - scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) { + scope 12 (inlined ptr::mut_ptr::<impl *mut u32>::add) { debug self => _7; debug count => _3; - scope 9 { + scope 13 { } } - scope 10 (inlined slice_from_raw_parts_mut::<u32>) { + scope 14 (inlined slice_from_raw_parts_mut::<u32>) { debug data => _8; debug len => _6; let mut _9: *mut (); - scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { + scope 15 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) { debug self => _8; } - scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { + scope 16 (inlined std::ptr::from_raw_parts_mut::<[u32]>) { debug data_address => _9; debug metadata => _6; let mut _10: *const (); let mut _11: std::ptr::metadata::PtrComponents<[u32]>; let mut _12: std::ptr::metadata::PtrRepr<[u32]>; - scope 13 { + scope 17 { + } + } + } + } + scope 7 (inlined <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::runtime::<u32>) { + debug ((this: std::ops::Range<usize>).0: usize) => _15; + debug ((this: std::ops::Range<usize>).1: usize) => _16; + debug slice => _5; + scope 8 (inlined ptr::mut_ptr::<impl *mut [u32]>::len) { + debug self => _5; + let mut _14: *const [u32]; + scope 9 (inlined std::ptr::metadata::<[u32]>) { + debug ptr => _14; + scope 10 { } } } @@ -63,9 +80,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> _4 = move (_2.1: usize); StorageLive(_5); _5 = &raw mut (*_1); + StorageLive(_6); StorageLive(_14); StorageLive(_15); - StorageLive(_6); + StorageLive(_16); _6 = SubUnchecked(_4, _3); StorageLive(_8); StorageLive(_7); @@ -86,9 +104,10 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> StorageDead(_12); StorageDead(_9); StorageDead(_8); - StorageDead(_6); - StorageDead(_14); + StorageDead(_16); StorageDead(_15); + StorageDead(_14); + StorageDead(_6); StorageDead(_5); _0 = &mut (*_13); return; diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index 836fa2677..3d76bab7c 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -195,7 +195,7 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb11 (cleanup): { - drop(_2) -> [return: bb12, unwind terminate]; + drop(_2) -> [return: bb12, unwind terminate(cleanup)]; } bb12 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index 65baaf64a..e8586cec9 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -182,7 +182,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb11 (cleanup): { - drop(_2) -> [return: bb12, unwind terminate]; + drop(_2) -> [return: bb12, unwind terminate(cleanup)]; } bb12 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir index 4edf4b4fb..4afe2eda1 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir @@ -75,17 +75,19 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { _8 = Lt(move _6, move _7); StorageDead(_7); StorageDead(_6); - StorageDead(_22); - StorageDead(_21); switchInt(move _8) -> [0: bb2, otherwise: bb3]; } bb2: { + StorageDead(_22); + StorageDead(_21); _9 = Option::<usize>::None; goto -> bb5; } bb3: { + StorageDead(_22); + StorageDead(_21); _10 = (_5.0: usize); StorageLive(_11); _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind unreachable]; diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir index f7b19e80e..48092608d 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir @@ -75,17 +75,19 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { _8 = Lt(move _6, move _7); StorageDead(_7); StorageDead(_6); - StorageDead(_22); - StorageDead(_21); switchInt(move _8) -> [0: bb2, otherwise: bb3]; } bb2: { + StorageDead(_22); + StorageDead(_21); _9 = Option::<usize>::None; goto -> bb5; } bb3: { + StorageDead(_22); + StorageDead(_21); _10 = (_5.0: usize); StorageLive(_11); _11 = <usize as Step>::forward_unchecked(_10, const 1_usize) -> [return: bb4, unwind: bb12]; @@ -143,7 +145,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb12 (cleanup): { - drop(_2) -> [return: bb13, unwind terminate]; + drop(_2) -> [return: bb13, unwind terminate(cleanup)]; } bb13 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index 43f8806e1..3cdc49f60 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -196,7 +196,7 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb11 (cleanup): { - drop(_2) -> [return: bb12, unwind terminate]; + drop(_2) -> [return: bb12, unwind terminate(cleanup)]; } bb12 (cleanup): { diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 4e954aa34..179005636 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,6 +1,6 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug +// ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir index ed7107e53..1d3317efd 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir @@ -1,21 +1,21 @@ // MIR for `outer` after PreCodegen fn outer(_1: u8) -> u8 { - debug v => _1; // in scope 0 at $DIR/spans.rs:10:14: 10:15 - let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:10:24: 10:26 - let mut _2: &u8; // in scope 0 at $DIR/spans.rs:11:11: 11:13 + debug v => _1; // in scope 0 at $DIR/spans.rs:9:14: 9:15 + let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:9:24: 9:26 + let mut _2: &u8; // in scope 0 at $DIR/spans.rs:10:11: 10:13 bb0: { - StorageLive(_2); // scope 0 at $DIR/spans.rs:11:11: 11:13 - _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = inner(move _2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/spans.rs:11:5: 11:14 - // mir::Constant - // + span: $DIR/spans.rs:11:5: 11:10 - // + literal: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(<ZST>) } + StorageLive(_2); // scope 0 at $DIR/spans.rs:10:11: 10:13 + _2 = &_1; // scope 0 at $DIR/spans.rs:10:11: 10:13 + _0 = inner(move _2) -> [return: bb1, unwind unreachable]; // scope 0 at $DIR/spans.rs:10:5: 10:14 + // mir::ConstOperand + // + span: $DIR/spans.rs:10:5: 10:10 + // + const_: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(inner) } } bb1: { - StorageDead(_2); // scope 0 at $DIR/spans.rs:11:13: 11:14 - return; // scope 0 at $DIR/spans.rs:12:2: 12:2 + StorageDead(_2); // scope 0 at $DIR/spans.rs:10:13: 10:14 + return; // scope 0 at $DIR/spans.rs:11:2: 11:2 } } diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir index dc436dc26..aba66861f 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir @@ -1,21 +1,21 @@ // MIR for `outer` after PreCodegen fn outer(_1: u8) -> u8 { - debug v => _1; // in scope 0 at $DIR/spans.rs:10:14: 10:15 - let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:10:24: 10:26 - let mut _2: &u8; // in scope 0 at $DIR/spans.rs:11:11: 11:13 + debug v => _1; // in scope 0 at $DIR/spans.rs:9:14: 9:15 + let mut _0: u8; // return place in scope 0 at $DIR/spans.rs:9:24: 9:26 + let mut _2: &u8; // in scope 0 at $DIR/spans.rs:10:11: 10:13 bb0: { - StorageLive(_2); // scope 0 at $DIR/spans.rs:11:11: 11:13 - _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = inner(move _2) -> [return: bb1, unwind continue]; // scope 0 at $DIR/spans.rs:11:5: 11:14 - // mir::Constant - // + span: $DIR/spans.rs:11:5: 11:10 - // + literal: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(<ZST>) } + StorageLive(_2); // scope 0 at $DIR/spans.rs:10:11: 10:13 + _2 = &_1; // scope 0 at $DIR/spans.rs:10:11: 10:13 + _0 = inner(move _2) -> [return: bb1, unwind continue]; // scope 0 at $DIR/spans.rs:10:5: 10:14 + // mir::ConstOperand + // + span: $DIR/spans.rs:10:5: 10:10 + // + const_: Const { ty: for<'a> fn(&'a u8) -> u8 {inner}, val: Value(inner) } } bb1: { - StorageDead(_2); // scope 0 at $DIR/spans.rs:11:13: 11:14 - return; // scope 0 at $DIR/spans.rs:12:2: 12:2 + StorageDead(_2); // scope 0 at $DIR/spans.rs:10:13: 10:14 + return; // scope 0 at $DIR/spans.rs:11:2: 11:2 } } diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs index 6ae9935ee..295eb0476 100644 --- a/tests/mir-opt/pre-codegen/spans.rs +++ b/tests/mir-opt/pre-codegen/spans.rs @@ -2,7 +2,6 @@ // // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // compile-flags: -Zmir-include-spans -// ignore-wasm32 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/try_identity.rs b/tests/mir-opt/pre-codegen/try_identity.rs index 079ecccab..a227c82d6 100644 --- a/tests/mir-opt/pre-codegen/try_identity.rs +++ b/tests/mir-opt/pre-codegen/try_identity.rs @@ -1,6 +1,5 @@ // compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // only-64bit -// ignore-debug // Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings // of that syntax. |