summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/inline
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:31 +0000
commit2ff14448863ac1a1dd9533461708e29aae170c2d (patch)
tree85b9fea2bbfe3f06473cfa381eed11f273b57c5c /src/test/mir-opt/inline
parentAdding debian version 1.64.0+dfsg1-1. (diff)
downloadrustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz
rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/test/mir-opt/inline/cycle.g.Inline.diff28
-rw-r--r--src/test/mir-opt/inline/cycle.main.Inline.diff50
-rw-r--r--src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff30
-rw-r--r--src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff12
-rw-r--r--src/test/mir-opt/inline/inline-into-box-place.rs2
-rw-r--r--src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir22
-rw-r--r--src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir8
-rw-r--r--src/test/mir-opt/inline/inline_cycle.one.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_cycle.two.Inline.diff30
-rw-r--r--src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_diverging.f.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_diverging.h.Inline.diff34
-rw-r--r--src/test/mir-opt/inline/inline_generator.main.Inline.diff90
-rw-r--r--src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff86
-rw-r--r--src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff)42
-rw-r--r--src/test/mir-opt/inline/inline_options.main.Inline.after.mir24
-rw-r--r--src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir30
-rw-r--r--src/test/mir-opt/inline/inline_specialization.main.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir12
-rw-r--r--src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir4
-rw-r--r--src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir4
-rw-r--r--src/test/mir-opt/inline/polymorphic-recursion.rs25
22 files changed, 228 insertions, 313 deletions
diff --git a/src/test/mir-opt/inline/cycle.g.Inline.diff b/src/test/mir-opt/inline/cycle.g.Inline.diff
index 59f34d379..5f3ee467c 100644
--- a/src/test/mir-opt/inline/cycle.g.Inline.diff
+++ b/src/test/mir-opt/inline/cycle.g.Inline.diff
@@ -6,10 +6,10 @@
let _1: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:12
+ let mut _2: fn() {main}; // in scope 0 at $DIR/cycle.rs:+1:5: +1:12
+ scope 1 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:+0:6: +0:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
++ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
++ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
++ let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
+ scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
+ }
+ }
@@ -25,10 +25,10 @@
- // mir::Constant
// + span: $DIR/cycle.rs:12:7: 12:11
// + literal: Const { ty: fn() {main}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
++ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
++ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
+ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
}
@@ -40,18 +40,18 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
+ }
+
+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:+0:8: +0:9
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
}
}
diff --git a/src/test/mir-opt/inline/cycle.main.Inline.diff b/src/test/mir-opt/inline/cycle.main.Inline.diff
index 6def7c3ee..8b4099b9d 100644
--- a/src/test/mir-opt/inline/cycle.main.Inline.diff
+++ b/src/test/mir-opt/inline/cycle.main.Inline.diff
@@ -6,17 +6,17 @@
let _1: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:9
+ let mut _2: fn() {g}; // in scope 0 at $DIR/cycle.rs:+1:5: +1:9
+ scope 1 (inlined f::<fn() {g}>) { // at $DIR/cycle.rs:17:5: 17:9
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:+0:6: +0:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ debug g => _2; // in scope 1 at $DIR/cycle.rs:5:6: 5:7
++ let _3: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
++ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:6:5: 6:6
++ let mut _5: (); // in scope 1 at $DIR/cycle.rs:6:5: 6:8
+ scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8
+ scope 3 (inlined g) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
-+ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:+0:5: +0:12
++ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:12:5: 12:12
+ scope 4 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
-+ debug g => _6; // in scope 4 at $DIR/cycle.rs:+0:6: +0:7
-+ let _7: (); // in scope 4 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:+0:5: +0:6
++ debug g => _6; // in scope 4 at $DIR/cycle.rs:5:6: 5:7
++ let _7: (); // in scope 4 at $DIR/cycle.rs:6:5: 6:8
++ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:6:5: 6:6
+ scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
+ }
+ }
@@ -35,14 +35,14 @@
- // mir::Constant
// + span: $DIR/cycle.rs:17:7: 17:8
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_6); // scope 3 at $DIR/cycle.rs:+0:5: +0:12
-+ StorageLive(_7); // scope 4 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_8); // scope 4 at $DIR/cycle.rs:+0:5: +0:6
-+ _8 = &_6; // scope 4 at $DIR/cycle.rs:+0:5: +0:6
++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6
++ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6
++ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ StorageLive(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
++ StorageLive(_7); // scope 4 at $DIR/cycle.rs:6:5: 6:8
++ StorageLive(_8); // scope 4 at $DIR/cycle.rs:6:5: 6:6
++ _8 = &_6; // scope 4 at $DIR/cycle.rs:6:5: 6:6
+ _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL
}
@@ -54,21 +54,21 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
+ }
+
+ bb4: {
-+ StorageDead(_8); // scope 4 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_7); // scope 4 at $DIR/cycle.rs:+0:8: +0:9
-+ StorageDead(_6); // scope 3 at $DIR/cycle.rs:+0:5: +0:12
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:+0:8: +0:9
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ StorageDead(_8); // scope 4 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_7); // scope 4 at $DIR/cycle.rs:6:8: 6:9
++ StorageDead(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_4); // scope 1 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_3); // scope 1 at $DIR/cycle.rs:6:8: 6:9
++ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:7:1: 7:2
}
}
diff --git a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
index 8eae04c4d..4b50ba950 100644
--- a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
+++ b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
@@ -10,12 +10,12 @@
scope 1 {
debug c => _2; // in scope 1 at $DIR/dyn-trait.rs:+1:9: +1:10
+ scope 2 (inlined try_execute_query::<<Q as Query>::C>) { // at $DIR/dyn-trait.rs:34:5: 34:25
-+ debug c => _4; // in scope 2 at $DIR/dyn-trait.rs:+0:36: +0:37
-+ let mut _5: &dyn Cache<V = <Q as Query>::V>; // in scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ let mut _6: &<Q as Query>::C; // in scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
++ debug c => _4; // in scope 2 at $DIR/dyn-trait.rs:26:36: 26:37
++ let mut _5: &dyn Cache<V = <Q as Query>::V>; // in scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ let mut _6: &<Q as Query>::C; // in scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
+ scope 3 (inlined mk_cycle::<<Q as Query>::V>) { // at $DIR/dyn-trait.rs:27:5: 27:16
-+ debug c => _5; // in scope 3 at $DIR/dyn-trait.rs:+0:27: +0:28
-+ let mut _7: &dyn Cache<V = <Q as Query>::V>; // in scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
++ debug c => _5; // in scope 3 at $DIR/dyn-trait.rs:20:27: 20:28
++ let mut _7: &dyn Cache<V = <Q as Query>::V>; // in scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
+ }
+ }
}
@@ -36,14 +36,14 @@
StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:+2:23: +2:24
_4 = &(*_2); // scope 1 at $DIR/dyn-trait.rs:+2:23: +2:24
- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> bb2; // scope 1 at $DIR/dyn-trait.rs:+2:5: +2:25
-+ StorageLive(_5); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageLive(_6); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ _6 = _4; // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ _5 = move _6 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageDead(_6); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageLive(_7); // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _7 = _5; // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _7) -> bb2; // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
++ StorageLive(_5); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageLive(_6); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ _6 = _4; // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ _5 = move _6 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageDead(_6); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageLive(_7); // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
++ _7 = _5; // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
++ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _7) -> bb2; // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
// mir::Constant
- // + span: $DIR/dyn-trait.rs:34:5: 34:22
- // + literal: Const { ty: for<'r> fn(&'r <Q as Query>::C) {try_execute_query::<<Q as Query>::C>}, val: Value(<ZST>) }
@@ -52,8 +52,8 @@
}
bb2: {
-+ StorageDead(_7); // scope 3 at $DIR/dyn-trait.rs:+0:21: +0:22
-+ StorageDead(_5); // scope 2 at $DIR/dyn-trait.rs:+0:15: +0:16
++ StorageDead(_7); // scope 3 at $DIR/dyn-trait.rs:21:21: 21:22
++ StorageDead(_5); // scope 2 at $DIR/dyn-trait.rs:27:15: 27:16
StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:+2:24: +2:25
StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:+3:1: +3:2
return; // scope 0 at $DIR/dyn-trait.rs:+3:2: +3:2
diff --git a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
index e7c5972f4..58c05b9f5 100644
--- a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
+++ b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
@@ -7,8 +7,8 @@
let mut _2: &dyn Cache<V = <C as Cache>::V>; // in scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15
let mut _3: &C; // in scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15
+ scope 1 (inlined mk_cycle::<<C as Cache>::V>) { // at $DIR/dyn-trait.rs:27:5: 27:16
-+ debug c => _2; // in scope 1 at $DIR/dyn-trait.rs:+0:27: +0:28
-+ let mut _4: &dyn Cache<V = <C as Cache>::V>; // in scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
++ debug c => _2; // in scope 1 at $DIR/dyn-trait.rs:20:27: 20:28
++ let mut _4: &dyn Cache<V = <C as Cache>::V>; // in scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
+ }
bb0: {
@@ -18,9 +18,9 @@
_2 = move _3 as &dyn Cache<V = <C as Cache>::V> (Pointer(Unsize)); // scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15
StorageDead(_3); // scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15
- _0 = mk_cycle::<<C as Cache>::V>(move _2) -> bb1; // scope 0 at $DIR/dyn-trait.rs:+1:5: +1:16
-+ StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _4 = _2; // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(move _4) -> bb1; // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
++ StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
++ _4 = _2; // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
++ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(move _4) -> bb1; // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
// mir::Constant
- // + span: $DIR/dyn-trait.rs:27:5: 27:13
- // + literal: Const { ty: for<'r> fn(&'r (dyn Cache<V = <C as Cache>::V> + 'r)) {mk_cycle::<<C as Cache>::V>}, val: Value(<ZST>) }
@@ -29,7 +29,7 @@
}
bb1: {
-+ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:+0:21: +0:22
++ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:21:21: 21:22
StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:+1:15: +1:16
return; // scope 0 at $DIR/dyn-trait.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/inline/inline-into-box-place.rs b/src/test/mir-opt/inline/inline-into-box-place.rs
index 049a97816..232bcc7b2 100644
--- a/src/test/mir-opt/inline/inline-into-box-place.rs
+++ b/src/test/mir-opt/inline/inline-into-box-place.rs
@@ -1,7 +1,7 @@
// ignore-endian-big
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -Z mir-opt-level=4
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
#![feature(box_syntax)]
// EMIT_MIR inline_into_box_place.main.Inline.diff
fn main() {
diff --git a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
index 630225258..b27425fb1 100644
--- a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
@@ -9,10 +9,10 @@ fn bar() -> bool {
scope 1 {
debug f => _1; // in scope 1 at $DIR/inline-any-operand.rs:+1:9: +1:10
scope 2 (inlined foo) { // at $DIR/inline-any-operand.rs:12:5: 12:13
- debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:+6:8: +6:9
- debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:+6:16: +6:17
- let mut _5: i32; // in scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- let mut _6: i32; // in scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
+ debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9
+ debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17
+ let mut _5: i32; // in scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ let mut _6: i32; // in scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
}
}
@@ -28,13 +28,13 @@ fn bar() -> bool {
_3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageLive(_4); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
_4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
- StorageLive(_5); // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- _5 = _3; // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- StorageLive(_6); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- _6 = _4; // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- _0 = Eq(move _5, move _6); // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:11
- StorageDead(_6); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- StorageDead(_5); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
+ StorageLive(_5); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ _5 = _3; // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ StorageLive(_6); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ _6 = _4; // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ _0 = Eq(move _5, move _6); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
+ StorageDead(_6); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ StorageDead(_5); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
StorageDead(_4); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageDead(_3); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:+2:12: +2:13
diff --git a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
index d60b06460..a2234e7c1 100644
--- a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
@@ -19,8 +19,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:+0:17: +0:18
let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
- let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
+ let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
+ let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
}
}
@@ -45,15 +45,11 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
StorageLive(_9); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9
_9 = move (_7.0: i32); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9
StorageLive(_10); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
- StorageLive(_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
_12 = deref_copy ((*_6).0: &i32); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
_10 = (*_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
- StorageDead(_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
StorageLive(_11); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- StorageLive(_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
_13 = deref_copy ((*_6).1: &T); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
_11 = (*_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- StorageDead(_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
Deinit(_0); // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
(_0.0: i32) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
(_0.1: T) = move _11; // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
diff --git a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
index b1c476362..a4d706de0 100644
--- a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
@@ -14,7 +14,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:24
- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:24
-+ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline-cycle.rs:+23:9: +23:28
++ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline-cycle.rs:36:9: 36:28
// mir::Constant
- // + span: $DIR/inline-cycle.rs:14:5: 14:22
+ // + span: $DIR/inline-cycle.rs:36:9: 36:26
diff --git a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
index dc890a365..b1a5b62ef 100644
--- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
@@ -6,13 +6,13 @@
let _1: (); // in scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12
+ let mut _2: fn() {f}; // in scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12
+ scope 1 (inlined call::<fn() {f}>) { // at $DIR/inline-cycle.rs:49:5: 49:12
-+ debug f => _2; // in scope 1 at $DIR/inline-cycle.rs:+5:22: +5:23
-+ let _3: (); // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ let mut _4: fn() {f}; // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ let mut _5: (); // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
++ debug f => _2; // in scope 1 at $DIR/inline-cycle.rs:53:22: 53:23
++ let _3: (); // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:8
++ let mut _4: fn() {f}; // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:6
++ let mut _5: (); // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:8
+ scope 2 (inlined <fn() {f} as FnOnce<()>>::call_once - shim(fn() {f})) { // at $DIR/inline-cycle.rs:54:5: 54:8
+ scope 3 (inlined f) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
-+ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
++ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
+ }
+ }
+ }
@@ -26,12 +26,12 @@
- // + span: $DIR/inline-cycle.rs:49:5: 49:9
+ // + span: $DIR/inline-cycle.rs:49:10: 49:11
+ // + literal: Const { ty: fn() {f}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ StorageLive(_4); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ _4 = move _2; // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ StorageLive(_5); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ StorageLive(_6); // scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
-+ _6 = call::<fn() {f}>(f) -> bb1; // scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
++ StorageLive(_3); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8
++ StorageLive(_4); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:6
++ _4 = move _2; // scope 1 at $DIR/inline-cycle.rs:54:5: 54:6
++ StorageLive(_5); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8
++ StorageLive(_6); // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
++ _6 = call::<fn() {f}>(f) -> bb1; // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
+ // mir::Constant
+ // + span: $DIR/inline-cycle.rs:59:5: 59:9
// + literal: Const { ty: fn(fn() {f}) {call::<fn() {f}>}, val: Value(<ZST>) }
@@ -42,10 +42,10 @@
}
bb1: {
-+ StorageDead(_6); // scope 3 at $DIR/inline-cycle.rs:+11:12: +11:13
-+ StorageDead(_5); // scope 1 at $DIR/inline-cycle.rs:+6:7: +6:8
-+ StorageDead(_4); // scope 1 at $DIR/inline-cycle.rs:+6:7: +6:8
-+ StorageDead(_3); // scope 1 at $DIR/inline-cycle.rs:+6:8: +6:9
++ StorageDead(_6); // scope 3 at $DIR/inline-cycle.rs:59:12: 59:13
++ StorageDead(_5); // scope 1 at $DIR/inline-cycle.rs:54:7: 54:8
++ StorageDead(_4); // scope 1 at $DIR/inline-cycle.rs:54:7: 54:8
++ StorageDead(_3); // scope 1 at $DIR/inline-cycle.rs:54:8: 54:9
+ StorageDead(_2); // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12
StorageDead(_1); // scope 0 at $DIR/inline-cycle.rs:+1:12: +1:13
_0 = const (); // scope 0 at $DIR/inline-cycle.rs:+0:10: +2:2
diff --git a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
index 082f57e59..fc5d57ce8 100644
--- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
@@ -16,7 +16,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-cycle-generic.rs:+1:5: +1:24
- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:+1:5: +1:24
-+ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline-cycle-generic.rs:+23:9: +23:28
++ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline-cycle-generic.rs:31:9: 31:28
// mir::Constant
- // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22
+ // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26
diff --git a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
index 6b24b3e16..cef4cfc67 100644
--- a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
@@ -18,7 +18,7 @@
+ }
+
+ bb1: {
-+ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:+32:5: +32:12
++ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:39:5: 39:12
}
}
diff --git a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
index 8759f3d02..6569ab24c 100644
--- a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
@@ -6,19 +6,19 @@
let _1: (!, !); // in scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22
+ let mut _2: fn() -> ! {sleep}; // in scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22
+ scope 1 (inlined call_twice::<!, fn() -> ! {sleep}>) { // at $DIR/inline-diverging.rs:22:5: 22:22
-+ debug f => _2; // in scope 1 at $DIR/inline-diverging.rs:+5:36: +5:37
-+ let _3: !; // in scope 1 at $DIR/inline-diverging.rs:+6:9: +6:10
-+ let mut _4: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ let mut _5: (); // in scope 1 at $DIR/inline-diverging.rs:+6:13: +6:16
-+ let mut _7: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:+7:13: +7:14
-+ let mut _8: (); // in scope 1 at $DIR/inline-diverging.rs:+7:13: +7:16
-+ let mut _9: !; // in scope 1 at $DIR/inline-diverging.rs:+8:6: +8:7
-+ let mut _10: !; // in scope 1 at $DIR/inline-diverging.rs:+8:9: +8:10
++ debug f => _2; // in scope 1 at $DIR/inline-diverging.rs:26:36: 26:37
++ let _3: !; // in scope 1 at $DIR/inline-diverging.rs:27:9: 27:10
++ let mut _4: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:27:13: 27:14
++ let mut _5: (); // in scope 1 at $DIR/inline-diverging.rs:27:13: 27:16
++ let mut _7: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:28:13: 28:14
++ let mut _8: (); // in scope 1 at $DIR/inline-diverging.rs:28:13: 28:16
++ let mut _9: !; // in scope 1 at $DIR/inline-diverging.rs:29:6: 29:7
++ let mut _10: !; // in scope 1 at $DIR/inline-diverging.rs:29:9: 29:10
+ scope 2 {
-+ debug a => _3; // in scope 2 at $DIR/inline-diverging.rs:+6:9: +6:10
-+ let _6: !; // in scope 2 at $DIR/inline-diverging.rs:+7:9: +7:10
++ debug a => _3; // in scope 2 at $DIR/inline-diverging.rs:27:9: 27:10
++ let _6: !; // in scope 2 at $DIR/inline-diverging.rs:28:9: 28:10
+ scope 3 {
-+ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:+7:9: +7:10
++ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:28:9: 28:10
+ }
+ scope 6 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) { // at $DIR/inline-diverging.rs:28:13: 28:16
+ scope 7 (inlined sleep) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
@@ -42,15 +42,15 @@
- // mir::Constant
// + span: $DIR/inline-diverging.rs:22:16: 22:21
// + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:+6:9: +6:10
-+ StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ _4 = &_2; // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ StorageLive(_5); // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:16
-+ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:+18:5: +18:12
++ StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:27:9: 27:10
++ StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:27:13: 27:14
++ _4 = &_2; // scope 1 at $DIR/inline-diverging.rs:27:13: 27:14
++ StorageLive(_5); // scope 1 at $DIR/inline-diverging.rs:27:13: 27:16
++ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:39:5: 39:12
+ }
+
+ bb1: {
-+ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:+18:5: +18:12
++ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:39:5: 39:12
}
}
diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff
index c7c2759cc..0b992e3c3 100644
--- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff
@@ -24,15 +24,15 @@
+ }
+ }
+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline-generator.rs:9:14: 9:46
-+ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:+7:6: +7:7
-+ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
-+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:+7:9: +7:9
-+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:+7:6: +7:7
-+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
++ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:15:17: 15:39
++ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9
++ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
++ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
bb0: {
@@ -47,8 +47,8 @@
- }
-
- bb1: {
-+ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:+7:5: +7:41
-+ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:+7:5: +7:41
++ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
++ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
_3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:+1:23: +1:31
- _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
- // mir::Constant
@@ -75,17 +75,13 @@
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
-+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
-+ StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
- bb3: {
+ bb1: {
-+ StorageDead(_12); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
@@ -102,55 +98,51 @@
+ }
+
+ bb3: {
-+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
-+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
++ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
++ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ }
+
+ bb4: {
-+ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:+7:24: +7:25
-+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
++ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25
++ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ }
+
+ bb5: {
-+ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:+7:35: +7:37
-+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
++ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:15:35: 15:37
++ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ }
+
+ bb6: {
-+ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:+7:38: +7:39
-+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ StorageLive(_14); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ _14 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:+7:11: +7:39
++ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
++ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ _14 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
+ }
+
+ bb7: {
-+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:+7:38: +7:39
-+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:+7:8: +7:8
++ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
++ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41
+ }
+
+ bb8: {
-+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
+
+ bb9: {
-+ unreachable; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
}
diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
deleted file mode 100644
index deaba70e0..000000000
--- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
+++ /dev/null
@@ -1,86 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:+0:11: +0:11
- let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:9: +1:11
- let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
- let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _8: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
-+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- scope 1 {
- debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:+1:9: +1:11
- }
- scope 2 {
- }
-+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ let mut _10: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:+1:9: +1:11
- _2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- _3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1: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(<ZST>) }
- }
-
- bb1: {
- StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- _5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- _7 = (((_5.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ StorageLive(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ _9 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ StorageLive(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ _10 = const alloc::raw_vec::RawVec::<u32>::NEW; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- // mir::Constant
-- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
-- // + user_ty: UserType(1)
-- // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) }
-- }
--
-- bb2: {
-+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ // + user_ty: UserType(0)
-+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) }
-+ Deinit((*_9)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).0: alloc::raw_vec::RawVec<u32>) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- _1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
- _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:+0:11: +2:2
-- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
-+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
- }
-
-- bb3: {
-+ bb2: {
- StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
- return; // scope 0 at $DIR/inline-into-box-place.rs:+2:2: +2:2
- }
-
-- bb4 (cleanup): {
-- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- _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)) -> bb5; // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
-- // mir::Constant
-- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
-- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(<ZST>) }
-- }
--
-- bb5 (cleanup): {
-+ bb3 (cleanup): {
- resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff
index deaba70e0..7e017373b 100644
--- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
+++ b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff
@@ -10,15 +10,14 @@
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- let mut _8: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
-+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ let mut _8: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:+1:9: +1:11
}
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
-+ let mut _10: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ let mut _9: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ }
bb0: {
@@ -34,13 +33,12 @@
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
- StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
_7 = (((_5.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ StorageLive(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ _9 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-+ StorageLive(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ _10 = const alloc::raw_vec::RawVec::<u32>::NEW; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ StorageLive(_8); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ _8 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ StorageLive(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ _9 = const _; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
// mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
- // + user_ty: UserType(1)
@@ -51,16 +49,15 @@
+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) }
-+ Deinit((*_9)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).0: alloc::raw_vec::RawVec<u32>) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_10); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ StorageDead(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ Deinit((*_8)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ ((*_8).0: alloc::raw_vec::RawVec<u32>) = move _9; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ ((*_8).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ StorageDead(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ StorageDead(_8); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:+0:11: +2:2
-- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
+- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
}
@@ -71,16 +68,15 @@
}
- bb4 (cleanup): {
-- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- _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)) -> bb5; // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
-- // mir::Constant
-- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
-- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(<ZST>) }
++ bb3 (cleanup): {
+ resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
- }
-
- bb5 (cleanup): {
-+ bb3 (cleanup): {
- resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
+- _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:+1:42: +1:43
+- // mir::Constant
+- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
+- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(<ZST>) }
}
}
diff --git a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir b/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
index 275493066..361b02715 100644
--- a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
@@ -5,9 +5,9 @@ fn main() -> () {
let _1: (); // in scope 0 at $DIR/inline-options.rs:+1:5: +1:18
let _2: (); // in scope 0 at $DIR/inline-options.rs:+2:5: +2:21
scope 1 (inlined inlined::<u32>) { // at $DIR/inline-options.rs:10:5: 10:21
- let _3: (); // in scope 1 at $DIR/inline-options.rs:+8:23: +8:26
- let _4: (); // in scope 1 at $DIR/inline-options.rs:+8:28: +8:31
- let _5: (); // in scope 1 at $DIR/inline-options.rs:+8:33: +8:36
+ let _3: (); // in scope 1 at $DIR/inline-options.rs:16:23: 16:26
+ let _4: (); // in scope 1 at $DIR/inline-options.rs:16:28: 16:31
+ let _5: (); // in scope 1 at $DIR/inline-options.rs:16:33: 16:36
}
bb0: {
@@ -21,33 +21,33 @@ fn main() -> () {
bb1: {
StorageDead(_1); // scope 0 at $DIR/inline-options.rs:+1:18: +1:19
StorageLive(_2); // scope 0 at $DIR/inline-options.rs:+2:5: +2:21
- StorageLive(_3); // scope 1 at $DIR/inline-options.rs:+8:23: +8:26
- _3 = g() -> bb2; // scope 1 at $DIR/inline-options.rs:+8:23: +8:26
+ StorageLive(_3); // scope 1 at $DIR/inline-options.rs:16:23: 16:26
+ _3 = g() -> bb2; // scope 1 at $DIR/inline-options.rs:16:23: 16:26
// mir::Constant
// + span: $DIR/inline-options.rs:16:23: 16:24
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_3); // scope 1 at $DIR/inline-options.rs:+8:26: +8:27
- StorageLive(_4); // scope 1 at $DIR/inline-options.rs:+8:28: +8:31
- _4 = g() -> bb3; // scope 1 at $DIR/inline-options.rs:+8:28: +8:31
+ StorageDead(_3); // scope 1 at $DIR/inline-options.rs:16:26: 16:27
+ StorageLive(_4); // scope 1 at $DIR/inline-options.rs:16:28: 16:31
+ _4 = g() -> bb3; // scope 1 at $DIR/inline-options.rs:16:28: 16:31
// mir::Constant
// + span: $DIR/inline-options.rs:16:28: 16:29
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb3: {
- StorageDead(_4); // scope 1 at $DIR/inline-options.rs:+8:31: +8:32
- StorageLive(_5); // scope 1 at $DIR/inline-options.rs:+8:33: +8:36
- _5 = g() -> bb4; // scope 1 at $DIR/inline-options.rs:+8:33: +8:36
+ StorageDead(_4); // scope 1 at $DIR/inline-options.rs:16:31: 16:32
+ StorageLive(_5); // scope 1 at $DIR/inline-options.rs:16:33: 16:36
+ _5 = g() -> bb4; // scope 1 at $DIR/inline-options.rs:16:33: 16:36
// mir::Constant
// + span: $DIR/inline-options.rs:16:33: 16:34
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb4: {
- StorageDead(_5); // scope 1 at $DIR/inline-options.rs:+8:36: +8:37
+ StorageDead(_5); // scope 1 at $DIR/inline-options.rs:16:36: 16:37
StorageDead(_2); // scope 0 at $DIR/inline-options.rs:+2:21: +2:22
_0 = const (); // scope 0 at $DIR/inline-options.rs:+0:11: +3:2
return; // scope 0 at $DIR/inline-options.rs:+3:2: +3:2
diff --git a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
index 768608564..cabc1a920 100644
--- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
@@ -15,10 +15,10 @@ fn bar() -> bool {
let mut _9: &i32; // in scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
let mut _10: &i32; // in scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
scope 2 (inlined foo) { // at $DIR/inline-retag.rs:12:5: 12:15
- debug x => _3; // in scope 2 at $DIR/inline-retag.rs:+6:8: +6:9
- debug y => _6; // in scope 2 at $DIR/inline-retag.rs:+6:17: +6:18
- let mut _11: i32; // in scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- let mut _12: i32; // in scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
+ debug x => _3; // in scope 2 at $DIR/inline-retag.rs:16:8: 16:9
+ debug y => _6; // in scope 2 at $DIR/inline-retag.rs:16:17: 16:18
+ let mut _11: i32; // in scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ let mut _12: i32; // in scope 2 at $DIR/inline-retag.rs:17:11: 17:13
}
}
@@ -32,7 +32,7 @@ fn bar() -> bool {
_2 = _1; // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6
StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
StorageLive(_4); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
- _10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
+ _10 = const _; // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
// mir::Constant
// + span: $DIR/inline-retag.rs:12:7: 12:9
// + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[1])) }
@@ -43,7 +43,7 @@ fn bar() -> bool {
Retag(_3); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
StorageLive(_6); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
StorageLive(_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
- _9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
+ _9 = const _; // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
// mir::Constant
// + span: $DIR/inline-retag.rs:12:11: 12:14
// + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[0])) }
@@ -52,15 +52,15 @@ fn bar() -> bool {
Retag(_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
_6 = &(*_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
Retag(_6); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
- Retag(_3); // scope 2 at $DIR/inline-retag.rs:+6:1: +8:2
- Retag(_6); // scope 2 at $DIR/inline-retag.rs:+6:1: +8:2
- StorageLive(_11); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- _11 = (*_3); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- StorageLive(_12); // scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
- _12 = (*_6); // scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
- _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:13
- StorageDead(_12); // scope 2 at $DIR/inline-retag.rs:+7:12: +7:13
- StorageDead(_11); // scope 2 at $DIR/inline-retag.rs:+7:12: +7:13
+ Retag(_3); // scope 2 at $DIR/inline-retag.rs:16:8: 16:9
+ Retag(_6); // scope 2 at $DIR/inline-retag.rs:16:17: 16:18
+ StorageLive(_11); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ _11 = (*_3); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ StorageLive(_12); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _12 = (*_6); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline-retag.rs:17:5: 17:13
+ StorageDead(_12); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+ StorageDead(_11); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
StorageDead(_6); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
StorageDead(_3); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
StorageDead(_2); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
diff --git a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
index 106291b36..fdf2a1e1f 100644
--- a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
@@ -19,7 +19,7 @@
- }
-
- bb1: {
-+ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:+10:31: +10:34
++ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
_0 = const (); // scope 0 at $DIR/inline-specialization.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/inline-specialization.rs:+2:1: +2:2
return; // scope 0 at $DIR/inline-specialization.rs:+2:2: +2:2
diff --git a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
index 116ae4e36..b8896430d 100644
--- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
@@ -6,8 +6,8 @@ fn test2(_1: &dyn X) -> bool {
let mut _2: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11
let mut _3: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11
scope 1 (inlined test) { // at $DIR/inline-trait-method_2.rs:5:5: 5:12
- debug x => _2; // in scope 1 at $DIR/inline-trait-method_2.rs:+5:9: +5:10
- let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
+ debug x => _2; // in scope 1 at $DIR/inline-trait-method_2.rs:9:9: 9:10
+ let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
}
bb0: {
@@ -16,16 +16,16 @@ fn test2(_1: &dyn X) -> bool {
_3 = &(*_1); // scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11
_2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11
StorageDead(_3); // scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11
- StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
- _4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
- _0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
+ StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+ _4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+ _0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
// mir::Constant
// + span: $DIR/inline-trait-method_2.rs:10:7: 10:8
// + literal: Const { ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:+6:9: +6:10
+ StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:9: 10:10
StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:+1:11: +1:12
return; // scope 0 at $DIR/inline-trait-method_2.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
index 4006dd15a..06d442ae8 100644
--- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
@@ -21,13 +21,9 @@ fn b(_1: &mut Box<T>) -> &mut T {
_4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageLive(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_7 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_8 = (((_7.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_6 = &mut (*_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
index e516269c1..d5f06c54a 100644
--- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
+++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
@@ -15,13 +15,9 @@ fn d(_1: &Box<T>) -> &T {
StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
_3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
- StorageLive(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_4 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_2 = &(*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_0 = &(*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:14: +1:15
StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:1: +2:2
diff --git a/src/test/mir-opt/inline/polymorphic-recursion.rs b/src/test/mir-opt/inline/polymorphic-recursion.rs
new file mode 100644
index 000000000..7388722b7
--- /dev/null
+++ b/src/test/mir-opt/inline/polymorphic-recursion.rs
@@ -0,0 +1,25 @@
+// Make sure that the MIR inliner does not loop indefinitely on polymorphic recursion.
+// compile-flags: --crate-type lib
+
+// Randomize `def_path_hash` by defining them under a module with different names
+macro_rules! emit {
+ ($($m:ident)*) => {$(
+ pub mod $m {
+ pub trait Tr { type Next: Tr; }
+
+ pub fn hoge<const N: usize, T: Tr>() {
+ inner::<N, T>();
+ }
+
+ #[inline(always)]
+ fn inner<const N: usize, T: Tr>()
+ {
+ inner::<N, T::Next>();
+ inner::<N, T::Next>();
+ }
+ }
+ )*};
+}
+
+// Increase the chance of triggering the bug
+emit!(m00 m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 m11 m12 m13 m14 m15 m16 m17 m18 m19);