diff options
Diffstat (limited to 'src/test/mir-opt/inline')
41 files changed, 928 insertions, 928 deletions
diff --git a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff b/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff index d30c74897b3..d7deb9c66cf 100644 --- a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff +++ b/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff @@ -2,32 +2,32 @@ + // MIR for `foo` after Inline fn foo() -> () { - let mut _0: (); // return place in scope 0 at $DIR/caller-with-trivial-bound.rs:17:1: 17:1 - let mut _1: <IntFactory as Factory<T>>::Item; // in scope 0 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 + let mut _0: (); // return place in scope 0 at $DIR/caller-with-trivial-bound.rs:+1:1: +1:1 + let mut _1: <IntFactory as Factory<T>>::Item; // in scope 0 at $DIR/caller-with-trivial-bound.rs:+4:9: +4:14 scope 1 { - debug x => _1; // in scope 1 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 + debug x => _1; // in scope 1 at $DIR/caller-with-trivial-bound.rs:+4:9: +4:14 } bb0: { - StorageLive(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 - _1 = bar::<T>() -> bb1; // scope 0 at $DIR/caller-with-trivial-bound.rs:20:51: 20:61 + StorageLive(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:+4:9: +4:14 + _1 = bar::<T>() -> bb1; // scope 0 at $DIR/caller-with-trivial-bound.rs:+4:51: +4:61 // mir::Constant // + span: $DIR/caller-with-trivial-bound.rs:20:51: 20:59 // + literal: Const { ty: fn() -> <IntFactory as Factory<T>>::Item {bar::<T>}, val: Value(<ZST>) } } bb1: { - _0 = const (); // scope 0 at $DIR/caller-with-trivial-bound.rs:19:1: 21:2 - drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/caller-with-trivial-bound.rs:21:1: 21:2 + _0 = const (); // scope 0 at $DIR/caller-with-trivial-bound.rs:+3:1: +5:2 + drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/caller-with-trivial-bound.rs:+5:1: +5:2 } bb2: { - StorageDead(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:21:1: 21:2 - return; // scope 0 at $DIR/caller-with-trivial-bound.rs:21:2: 21:2 + StorageDead(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:+5:1: +5:2 + return; // scope 0 at $DIR/caller-with-trivial-bound.rs:+5:2: +5:2 } bb3 (cleanup): { - resume; // scope 0 at $DIR/caller-with-trivial-bound.rs:16:1: 21:2 + resume; // scope 0 at $DIR/caller-with-trivial-bound.rs:+0:1: +5:2 } } diff --git a/src/test/mir-opt/inline/cycle.f.Inline.diff b/src/test/mir-opt/inline/cycle.f.Inline.diff index 1376ba99d99..40fdd1cdb19 100644 --- a/src/test/mir-opt/inline/cycle.f.Inline.diff +++ b/src/test/mir-opt/inline/cycle.f.Inline.diff @@ -2,42 +2,42 @@ + // MIR for `f` after Inline fn f(_1: impl Fn()) -> () { - debug g => _1; // in scope 0 at $DIR/cycle.rs:5:6: 5:7 - let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:5:20: 5:20 - let _2: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8 - let mut _3: &impl Fn(); // in scope 0 at $DIR/cycle.rs:6:5: 6:6 - let mut _4: (); // in scope 0 at $DIR/cycle.rs:6:5: 6:8 + debug g => _1; // in scope 0 at $DIR/cycle.rs:+0:6: +0:7 + let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:20: +0:20 + let _2: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:8 + let mut _3: &impl Fn(); // in scope 0 at $DIR/cycle.rs:+1:5: +1:6 + let mut _4: (); // in scope 0 at $DIR/cycle.rs:+1:5: +1:8 bb0: { - StorageLive(_2); // scope 0 at $DIR/cycle.rs:6:5: 6:8 - StorageLive(_3); // scope 0 at $DIR/cycle.rs:6:5: 6:6 - _3 = &_1; // scope 0 at $DIR/cycle.rs:6:5: 6:6 - StorageLive(_4); // scope 0 at $DIR/cycle.rs:6:5: 6:8 - Deinit(_4); // scope 0 at $DIR/cycle.rs:6:5: 6:8 - _2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:6:5: 6:8 + StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:8 + StorageLive(_3); // scope 0 at $DIR/cycle.rs:+1:5: +1:6 + _3 = &_1; // scope 0 at $DIR/cycle.rs:+1:5: +1:6 + StorageLive(_4); // scope 0 at $DIR/cycle.rs:+1:5: +1:8 + Deinit(_4); // scope 0 at $DIR/cycle.rs:+1:5: +1:8 + _2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:+1:5: +1:8 // mir::Constant // + span: $DIR/cycle.rs:6:5: 6:6 // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) } } bb1: { - StorageDead(_4); // scope 0 at $DIR/cycle.rs:6:7: 6:8 - StorageDead(_3); // scope 0 at $DIR/cycle.rs:6:7: 6:8 - StorageDead(_2); // scope 0 at $DIR/cycle.rs:6:8: 6:9 - _0 = const (); // scope 0 at $DIR/cycle.rs:5:20: 7:2 - drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/cycle.rs:7:1: 7:2 + StorageDead(_4); // scope 0 at $DIR/cycle.rs:+1:7: +1:8 + StorageDead(_3); // scope 0 at $DIR/cycle.rs:+1:7: +1:8 + StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:8: +1:9 + _0 = const (); // scope 0 at $DIR/cycle.rs:+0:20: +2:2 + drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/cycle.rs:+2:1: +2:2 } bb2: { - return; // scope 0 at $DIR/cycle.rs:7:2: 7:2 + return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2 } bb3 (cleanup): { - drop(_1) -> bb4; // scope 0 at $DIR/cycle.rs:7:1: 7:2 + drop(_1) -> bb4; // scope 0 at $DIR/cycle.rs:+2:1: +2:2 } bb4 (cleanup): { - resume; // scope 0 at $DIR/cycle.rs:5:1: 7:2 + resume; // scope 0 at $DIR/cycle.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/cycle.g.Inline.diff b/src/test/mir-opt/inline/cycle.g.Inline.diff index 5a8c147a327..59f34d379ec 100644 --- a/src/test/mir-opt/inline/cycle.g.Inline.diff +++ b/src/test/mir-opt/inline/cycle.g.Inline.diff @@ -2,56 +2,56 @@ + // MIR for `g` after Inline fn g() -> () { - let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:11:8: 11:8 - let _1: (); // in scope 0 at $DIR/cycle.rs:12:5: 12:12 -+ let mut _2: fn() {main}; // in scope 0 at $DIR/cycle.rs:12:5: 12:12 + let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:8: +0:8 + 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: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 ++ 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 + scope 2 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8 + } + } bb0: { - StorageLive(_1); // scope 0 at $DIR/cycle.rs:12:5: 12:12 -- _1 = f::<fn() {main}>(main) -> bb1; // scope 0 at $DIR/cycle.rs:12:5: 12:12 -+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12 -+ _2 = main; // scope 0 at $DIR/cycle.rs:12:5: 12:12 + StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:12 +- _1 = f::<fn() {main}>(main) -> bb1; // scope 0 at $DIR/cycle.rs:+1:5: +1:12 ++ StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:12 ++ _2 = main; // scope 0 at $DIR/cycle.rs:+1:5: +1:12 // mir::Constant - // + span: $DIR/cycle.rs:12:5: 12:6 - // + literal: Const { ty: fn(fn() {main}) {f::<fn() {main}>}, val: Value(<ZST>) } - // 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: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(_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 + _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { -+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:12:5: 12:12 - StorageDead(_1); // scope 0 at $DIR/cycle.rs:12:12: 12:13 - _0 = const (); // scope 0 at $DIR/cycle.rs:11:8: 13:2 - return; // scope 0 at $DIR/cycle.rs:13:2: 13:2 ++ StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:12 + StorageDead(_1); // scope 0 at $DIR/cycle.rs:+1:12: +1:13 + _0 = const (); // scope 0 at $DIR/cycle.rs:+0:8: +2:2 + return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2 + } + + bb2 (cleanup): { -+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2 + } + + bb3 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2 + } + + bb4: { -+ 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 ++ 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 } } diff --git a/src/test/mir-opt/inline/cycle.main.Inline.diff b/src/test/mir-opt/inline/cycle.main.Inline.diff index e102c650905..6def7c3ee3e 100644 --- a/src/test/mir-opt/inline/cycle.main.Inline.diff +++ b/src/test/mir-opt/inline/cycle.main.Inline.diff @@ -2,21 +2,21 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:16:11: 16:11 - let _1: (); // in scope 0 at $DIR/cycle.rs:17:5: 17:9 -+ let mut _2: fn() {g}; // in scope 0 at $DIR/cycle.rs:17:5: 17:9 + let mut _0: (); // return place in scope 0 at $DIR/cycle.rs:+0:11: +0:11 + 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: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 ++ 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 + 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:12:5: 12:12 ++ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:+0:5: +0: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: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 ++ 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 + scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8 + } + } @@ -25,50 +25,50 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/cycle.rs:17:5: 17:9 -- _1 = f::<fn() {g}>(g) -> bb1; // scope 0 at $DIR/cycle.rs:17:5: 17:9 -+ StorageLive(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9 -+ _2 = g; // scope 0 at $DIR/cycle.rs:17:5: 17:9 + StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:9 +- _1 = f::<fn() {g}>(g) -> bb1; // scope 0 at $DIR/cycle.rs:+1:5: +1:9 ++ StorageLive(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:9 ++ _2 = g; // scope 0 at $DIR/cycle.rs:+1:5: +1:9 // mir::Constant - // + span: $DIR/cycle.rs:17:5: 17:6 - // + literal: Const { ty: fn(fn() {g}) {f::<fn() {g}>}, val: Value(<ZST>) } - // 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: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 ++ 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 + _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL } bb1: { -+ StorageDead(_2); // scope 0 at $DIR/cycle.rs:17:5: 17:9 - StorageDead(_1); // scope 0 at $DIR/cycle.rs:17:9: 17:10 - _0 = const (); // scope 0 at $DIR/cycle.rs:16:11: 18:2 - return; // scope 0 at $DIR/cycle.rs:18:2: 18:2 ++ StorageDead(_2); // scope 0 at $DIR/cycle.rs:+1:5: +1:9 + StorageDead(_1); // scope 0 at $DIR/cycle.rs:+1:9: +1:10 + _0 = const (); // scope 0 at $DIR/cycle.rs:+0:11: +2:2 + return; // scope 0 at $DIR/cycle.rs:+2:2: +2:2 + } + + bb2 (cleanup): { -+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2 ++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2 + } + + bb3 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 ++ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2 + } + + bb4: { -+ 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 ++ 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 } } 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 7b306dd9482..49c91e956e7 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 @@ -2,29 +2,29 @@ + // MIR for `get_query` after Inline fn get_query(_1: &T) -> () { - debug t => _1; // in scope 0 at $DIR/dyn-trait.rs:32:31: 32:32 - let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:32:38: 32:38 - let _2: &<Q as Query>::C; // in scope 0 at $DIR/dyn-trait.rs:33:9: 33:10 - let mut _3: &T; // in scope 0 at $DIR/dyn-trait.rs:33:22: 33:23 - let mut _4: &<Q as Query>::C; // in scope 0 at $DIR/dyn-trait.rs:34:23: 34:24 + debug t => _1; // in scope 0 at $DIR/dyn-trait.rs:+0:31: +0:32 + let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:+0:38: +0:38 + let _2: &<Q as Query>::C; // in scope 0 at $DIR/dyn-trait.rs:+1:9: +1:10 + let mut _3: &T; // in scope 0 at $DIR/dyn-trait.rs:+1:22: +1:23 + let mut _4: &<Q as Query>::C; // in scope 0 at $DIR/dyn-trait.rs:+2:23: +2:24 scope 1 { - debug c => _2; // in scope 1 at $DIR/dyn-trait.rs:33:9: 33:10 + 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: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 ++ 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 + 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: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 ++ 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 + } + } } bb0: { - StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:33:9: 33:10 - StorageLive(_3); // scope 0 at $DIR/dyn-trait.rs:33:22: 33:23 - _3 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:33:22: 33:23 - _2 = <Q as Query>::cache::<T>(move _3) -> bb1; // scope 0 at $DIR/dyn-trait.rs:33:13: 33:24 + StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:+1:9: +1:10 + StorageLive(_3); // scope 0 at $DIR/dyn-trait.rs:+1:22: +1:23 + _3 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:+1:22: +1:23 + _2 = <Q as Query>::cache::<T>(move _3) -> bb1; // scope 0 at $DIR/dyn-trait.rs:+1:13: +1:24 // mir::Constant // + span: $DIR/dyn-trait.rs:33:13: 33:21 // + user_ty: UserType(0) @@ -32,18 +32,18 @@ } bb1: { - StorageDead(_3); // scope 0 at $DIR/dyn-trait.rs:33:23: 33:24 - StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:34:23: 34:24 - _4 = &(*_2); // scope 1 at $DIR/dyn-trait.rs:34:23: 34:24 -- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> bb2; // scope 1 at $DIR/dyn-trait.rs:34:5: 34:25 -+ 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 + StorageDead(_3); // scope 0 at $DIR/dyn-trait.rs:+1:23: +1:24 + 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 // 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,15 +52,15 @@ } bb2: { -+ 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:34:24: 34:25 - StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:35:1: 35:2 - return; // scope 0 at $DIR/dyn-trait.rs:35:2: 35:2 ++ 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(_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 + } + + bb3 (cleanup): { -+ resume; // scope 0 at $DIR/dyn-trait.rs:32:1: 35:2 ++ resume; // scope 0 at $DIR/dyn-trait.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff index 2a909702a6d..994930ef4cf 100644 --- a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff +++ b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff @@ -2,22 +2,22 @@ + // MIR for `mk_cycle` after Inline fn mk_cycle(_1: &dyn Cache<V = V>) -> () { - debug c => _1; // in scope 0 at $DIR/dyn-trait.rs:20:27: 20:28 - let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:20:49: 20:49 - let mut _2: &dyn Cache<V = V>; // in scope 0 at $DIR/dyn-trait.rs:21:5: 21:22 + debug c => _1; // in scope 0 at $DIR/dyn-trait.rs:+0:27: +0:28 + let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:+0:49: +0:49 + let mut _2: &dyn Cache<V = V>; // in scope 0 at $DIR/dyn-trait.rs:+1:5: +1:22 bb0: { - StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:21:5: 21:22 - _2 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:21:5: 21:22 - _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> bb1; // scope 0 at $DIR/dyn-trait.rs:21:5: 21:22 + StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:+1:5: +1:22 + _2 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:+1:5: +1:22 + _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> bb1; // scope 0 at $DIR/dyn-trait.rs:+1:5: +1:22 // mir::Constant // + span: $DIR/dyn-trait.rs:21:7: 21:20 // + literal: Const { ty: for<'r> fn(&'r dyn Cache<V = V>) {<dyn Cache<V = V> as Cache>::store_nocache}, val: Value(<ZST>) } } bb1: { - StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:21:21: 21:22 - return; // scope 0 at $DIR/dyn-trait.rs:22:2: 22:2 + StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:+1:21: +1:22 + return; // scope 0 at $DIR/dyn-trait.rs:+2:2: +2: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 01ebc999cb3..805354d2804 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 @@ -2,25 +2,25 @@ + // MIR for `try_execute_query` after Inline fn try_execute_query(_1: &C) -> () { - debug c => _1; // in scope 0 at $DIR/dyn-trait.rs:26:36: 26:37 - let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:26:43: 26:43 - let mut _2: &dyn Cache<V = <C as Cache>::V>; // in scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 - let mut _3: &C; // in scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 + debug c => _1; // in scope 0 at $DIR/dyn-trait.rs:+0:36: +0:37 + let mut _0: (); // return place in scope 0 at $DIR/dyn-trait.rs:+0:43: +0:43 + 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: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 ++ 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 + } bb0: { - StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 - StorageLive(_3); // scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 - _3 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 - _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (Pointer(Unsize)); // scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 - StorageDead(_3); // scope 0 at $DIR/dyn-trait.rs:27:14: 27:15 -- _0 = mk_cycle::<<C as Cache>::V>(move _2) -> bb1; // scope 0 at $DIR/dyn-trait.rs:27:5: 27:16 -+ 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 + StorageLive(_2); // scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15 + StorageLive(_3); // scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15 + _3 = &(*_1); // scope 0 at $DIR/dyn-trait.rs:+1:14: +1:15 + _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 // 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,13 +29,13 @@ } bb1: { -+ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:21:21: 21:22 - StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:27:15: 27:16 - return; // scope 0 at $DIR/dyn-trait.rs:28:2: 28:2 ++ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:+0:21: +0: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 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/dyn-trait.rs:26:1: 28:2 ++ resume; // scope 0 at $DIR/dyn-trait.rs:+0:1: +2:2 } } 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 ff338ae58cd..77b5df943a3 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 @@ -1,48 +1,48 @@ // MIR for `bar` after Inline fn bar() -> bool { - let mut _0: bool; // return place in scope 0 at $DIR/inline-any-operand.rs:10:13: 10:17 - let _1: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10 - let mut _2: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:6 - let mut _3: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 - let mut _4: i32; // in scope 0 at $DIR/inline-any-operand.rs:12:5: 12:13 + let mut _0: bool; // return place in scope 0 at $DIR/inline-any-operand.rs:+0:13: +0:17 + let _1: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:+1:9: +1:10 + let mut _2: fn(i32, i32) -> bool {foo}; // in scope 0 at $DIR/inline-any-operand.rs:+2:5: +2:6 + let mut _3: i32; // in scope 0 at $DIR/inline-any-operand.rs:+2:5: +2:13 + let mut _4: i32; // in scope 0 at $DIR/inline-any-operand.rs:+2:5: +2:13 scope 1 { - debug f => _1; // in scope 1 at $DIR/inline-any-operand.rs:11:9: 11:10 + 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: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 + 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 } } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10 - _1 = foo; // scope 0 at $DIR/inline-any-operand.rs:11:13: 11:16 + StorageLive(_1); // scope 0 at $DIR/inline-any-operand.rs:+1:9: +1:10 + _1 = foo; // scope 0 at $DIR/inline-any-operand.rs:+1:13: +1:16 // mir::Constant // + span: $DIR/inline-any-operand.rs:11:13: 11:16 // + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(<ZST>) } - StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6 - _2 = _1; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6 - StorageLive(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - _3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - StorageLive(_4); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - _4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - 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:12:5: 12:13 - StorageDead(_3); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13 - StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13 - StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2 - return; // scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2 + StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:6 + _2 = _1; // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:6 + StorageLive(_3); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13 + _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 + 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 + StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:+3:1: +3:2 + return; // scope 0 at $DIR/inline-any-operand.rs:+3:2: +3:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-any-operand.rs:10:1: 13:2 + resume; // scope 0 at $DIR/inline-any-operand.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir index 66fc5fa80ea..d746e1a093a 100644 --- a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir @@ -1,53 +1,53 @@ // MIR for `foo` after Inline fn foo(_1: T, _2: i32) -> i32 { - debug _t => _1; // in scope 0 at $DIR/inline-closure.rs:10:17: 10:19 - debug q => _2; // in scope 0 at $DIR/inline-closure.rs:10:24: 10:25 - let mut _0: i32; // return place in scope 0 at $DIR/inline-closure.rs:10:35: 10:38 - let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:11:9: 11:10 - let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:12:5: 12:6 - let mut _5: (i32, i32); // in scope 0 at $DIR/inline-closure.rs:12:5: 12:12 - let mut _6: i32; // in scope 0 at $DIR/inline-closure.rs:12:7: 12:8 - let mut _7: i32; // in scope 0 at $DIR/inline-closure.rs:12:10: 12:11 - let mut _8: i32; // in scope 0 at $DIR/inline-closure.rs:12:5: 12:12 - let mut _9: i32; // in scope 0 at $DIR/inline-closure.rs:12:5: 12:12 + debug _t => _1; // in scope 0 at $DIR/inline-closure.rs:+0:17: +0:19 + debug q => _2; // in scope 0 at $DIR/inline-closure.rs:+0:24: +0:25 + let mut _0: i32; // return place in scope 0 at $DIR/inline-closure.rs:+0:35: +0:38 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:+1:9: +1:10 + let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure.rs:+2:5: +2:6 + let mut _5: (i32, i32); // in scope 0 at $DIR/inline-closure.rs:+2:5: +2:12 + let mut _6: i32; // in scope 0 at $DIR/inline-closure.rs:+2:7: +2:8 + let mut _7: i32; // in scope 0 at $DIR/inline-closure.rs:+2:10: +2:11 + let mut _8: i32; // in scope 0 at $DIR/inline-closure.rs:+2:5: +2:12 + let mut _9: i32; // in scope 0 at $DIR/inline-closure.rs:+2:5: +2:12 scope 1 { - debug x => _3; // in scope 1 at $DIR/inline-closure.rs:11:9: 11:10 + debug x => _3; // in scope 1 at $DIR/inline-closure.rs:+1:9: +1:10 scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline-closure.rs:12:5: 12:12 - debug _t => _8; // in scope 2 at $DIR/inline-closure.rs:11:14: 11:16 - debug _q => _9; // in scope 2 at $DIR/inline-closure.rs:11:18: 11:20 + debug _t => _8; // in scope 2 at $DIR/inline-closure.rs:+1:14: +1:16 + debug _q => _9; // in scope 2 at $DIR/inline-closure.rs:+1:18: +1:20 } } bb0: { - StorageLive(_3); // scope 0 at $DIR/inline-closure.rs:11:9: 11:10 - Deinit(_3); // scope 0 at $DIR/inline-closure.rs:11:13: 11:24 - StorageLive(_4); // scope 1 at $DIR/inline-closure.rs:12:5: 12:6 - _4 = &_3; // scope 1 at $DIR/inline-closure.rs:12:5: 12:6 - StorageLive(_5); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - StorageLive(_6); // scope 1 at $DIR/inline-closure.rs:12:7: 12:8 - _6 = _2; // scope 1 at $DIR/inline-closure.rs:12:7: 12:8 - StorageLive(_7); // scope 1 at $DIR/inline-closure.rs:12:10: 12:11 - _7 = _2; // scope 1 at $DIR/inline-closure.rs:12:10: 12:11 - Deinit(_5); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - (_5.0: i32) = move _6; // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - (_5.1: i32) = move _7; // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - StorageLive(_8); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - _8 = move (_5.0: i32); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - StorageLive(_9); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - _9 = move (_5.1: i32); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - _0 = _8; // scope 2 at $DIR/inline-closure.rs:11:22: 11:24 - StorageDead(_9); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - StorageDead(_8); // scope 1 at $DIR/inline-closure.rs:12:5: 12:12 - StorageDead(_7); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12 - StorageDead(_6); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12 - StorageDead(_5); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12 - StorageDead(_4); // scope 1 at $DIR/inline-closure.rs:12:11: 12:12 - StorageDead(_3); // scope 0 at $DIR/inline-closure.rs:13:1: 13:2 - return; // scope 0 at $DIR/inline-closure.rs:13:2: 13:2 + StorageLive(_3); // scope 0 at $DIR/inline-closure.rs:+1:9: +1:10 + Deinit(_3); // scope 0 at $DIR/inline-closure.rs:+1:13: +1:24 + StorageLive(_4); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:6 + _4 = &_3; // scope 1 at $DIR/inline-closure.rs:+2:5: +2:6 + StorageLive(_5); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + StorageLive(_6); // scope 1 at $DIR/inline-closure.rs:+2:7: +2:8 + _6 = _2; // scope 1 at $DIR/inline-closure.rs:+2:7: +2:8 + StorageLive(_7); // scope 1 at $DIR/inline-closure.rs:+2:10: +2:11 + _7 = _2; // scope 1 at $DIR/inline-closure.rs:+2:10: +2:11 + Deinit(_5); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + (_5.0: i32) = move _6; // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + (_5.1: i32) = move _7; // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + StorageLive(_8); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + _8 = move (_5.0: i32); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + StorageLive(_9); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + _9 = move (_5.1: i32); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + _0 = _8; // scope 2 at $DIR/inline-closure.rs:+1:22: +1:24 + StorageDead(_9); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + StorageDead(_8); // scope 1 at $DIR/inline-closure.rs:+2:5: +2:12 + StorageDead(_7); // scope 1 at $DIR/inline-closure.rs:+2:11: +2:12 + StorageDead(_6); // scope 1 at $DIR/inline-closure.rs:+2:11: +2:12 + StorageDead(_5); // scope 1 at $DIR/inline-closure.rs:+2:11: +2:12 + StorageDead(_4); // scope 1 at $DIR/inline-closure.rs:+2:11: +2:12 + StorageDead(_3); // scope 0 at $DIR/inline-closure.rs:+3:1: +3:2 + return; // scope 0 at $DIR/inline-closure.rs:+3:2: +3:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-closure.rs:10:1: 13:2 + resume; // scope 0 at $DIR/inline-closure.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index 7bb17dab061..84b3fb92cd5 100644 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -1,60 +1,60 @@ // MIR for `foo` after Inline fn foo(_1: T, _2: &i32) -> i32 { - debug _t => _1; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:17: 11:19 - debug q => _2; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:24: 11:25 - let mut _0: i32; // return place in scope 0 at $DIR/inline-closure-borrows-arg.rs:11:36: 11:39 - let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 - let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6 - let mut _5: (&i32, &i32); // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - let mut _6: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8 - let mut _7: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11 - let mut _8: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - let mut _9: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 + debug _t => _1; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+0:17: +0:19 + debug q => _2; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+0:24: +0:25 + let mut _0: i32; // return place in scope 0 at $DIR/inline-closure-borrows-arg.rs:+0:36: +0:39 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+1:9: +1:10 + let mut _4: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:6 + let mut _5: (&i32, &i32); // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + let mut _6: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:7: +5:8 + let mut _7: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:10: +5:11 + let mut _8: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + let mut _9: &i32; // in scope 0 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 scope 1 { - debug x => _3; // in scope 1 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 + debug x => _3; // in scope 1 at $DIR/inline-closure-borrows-arg.rs:+1:9: +1:10 scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - debug r => _8; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:14: 12:15 - debug _s => _9; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:12:23: 12:25 - let _10: &i32; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:13:13: 13:21 + debug r => _8; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:+1:14: +1:15 + debug _s => _9; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:+1:23: +1:25 + let _10: &i32; // in scope 2 at $DIR/inline-closure-borrows-arg.rs:+2:13: +2:21 scope 3 { - debug variable => _10; // in scope 3 at $DIR/inline-closure-borrows-arg.rs:13:13: 13:21 + debug variable => _10; // in scope 3 at $DIR/inline-closure-borrows-arg.rs:+2:13: +2:21 } } } bb0: { - StorageLive(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10 - Deinit(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:13: 15:6 - StorageLive(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6 - _4 = &_3; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6 - StorageLive(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageLive(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8 - _6 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8 - StorageLive(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11 - _7 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11 - Deinit(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - (_5.0: &i32) = move _6; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - (_5.1: &i32) = move _7; // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageLive(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - _8 = move (_5.0: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageLive(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - _9 = move (_5.1: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageLive(_10); // scope 2 at $DIR/inline-closure-borrows-arg.rs:13:13: 13:21 - _10 = _8; // scope 2 at $DIR/inline-closure-borrows-arg.rs:13:24: 13:27 - _0 = (*_10); // scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18 - StorageDead(_10); // scope 2 at $DIR/inline-closure-borrows-arg.rs:15:5: 15:6 - StorageDead(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageDead(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12 - StorageDead(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 - StorageDead(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 - StorageDead(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 - StorageDead(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12 - StorageDead(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:1: 17:2 - return; // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:2: 17:2 + StorageLive(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:+1:9: +1:10 + Deinit(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:+1:13: +4:6 + StorageLive(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:6 + _4 = &_3; // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:6 + StorageLive(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageLive(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:7: +5:8 + _6 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:7: +5:8 + StorageLive(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:10: +5:11 + _7 = &(*_2); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:10: +5:11 + Deinit(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + (_5.0: &i32) = move _6; // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + (_5.1: &i32) = move _7; // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageLive(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + _8 = move (_5.0: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageLive(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + _9 = move (_5.1: &i32); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageLive(_10); // scope 2 at $DIR/inline-closure-borrows-arg.rs:+2:13: +2:21 + _10 = _8; // scope 2 at $DIR/inline-closure-borrows-arg.rs:+2:24: +2:27 + _0 = (*_10); // scope 3 at $DIR/inline-closure-borrows-arg.rs:+3:9: +3:18 + StorageDead(_10); // scope 2 at $DIR/inline-closure-borrows-arg.rs:+4:5: +4:6 + StorageDead(_9); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageDead(_8); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:5: +5:12 + StorageDead(_7); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:11: +5:12 + StorageDead(_6); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:11: +5:12 + StorageDead(_5); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:11: +5:12 + StorageDead(_4); // scope 1 at $DIR/inline-closure-borrows-arg.rs:+5:11: +5:12 + StorageDead(_3); // scope 0 at $DIR/inline-closure-borrows-arg.rs:+6:1: +6:2 + return; // scope 0 at $DIR/inline-closure-borrows-arg.rs:+6:2: +6:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-closure-borrows-arg.rs:11:1: 17:2 + resume; // scope 0 at $DIR/inline-closure-borrows-arg.rs:+0:1: +6:2 } } 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 0e6ae6578e2..75693dc384b 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 @@ -1,73 +1,73 @@ // MIR for `foo` after Inline fn foo(_1: T, _2: i32) -> (i32, T) { - debug t => _1; // in scope 0 at $DIR/inline-closure-captures.rs:10:17: 10:18 - debug q => _2; // in scope 0 at $DIR/inline-closure-captures.rs:10:23: 10:24 - let mut _0: (i32, T); // return place in scope 0 at $DIR/inline-closure-captures.rs:10:34: 10:42 - let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10 - let mut _4: &i32; // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - let mut _5: &T; // in scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - let mut _6: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:6 - let mut _7: (i32,); // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9 - let mut _8: i32; // in scope 0 at $DIR/inline-closure-captures.rs:12:7: 12:8 - let mut _9: i32; // in scope 0 at $DIR/inline-closure-captures.rs:12:5: 12:9 + debug t => _1; // in scope 0 at $DIR/inline-closure-captures.rs:+0:17: +0:18 + debug q => _2; // in scope 0 at $DIR/inline-closure-captures.rs:+0:23: +0:24 + let mut _0: (i32, T); // return place in scope 0 at $DIR/inline-closure-captures.rs:+0:34: +0:42 + let _3: [closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:+1:9: +1:10 + let mut _4: &i32; // in scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + let mut _5: &T; // in scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + let mut _6: &[closure@foo<T>::{closure#0}]; // in scope 0 at $DIR/inline-closure-captures.rs:+2:5: +2:6 + let mut _7: (i32,); // in scope 0 at $DIR/inline-closure-captures.rs:+2:5: +2:9 + let mut _8: i32; // in scope 0 at $DIR/inline-closure-captures.rs:+2:7: +2:8 + let mut _9: i32; // in scope 0 at $DIR/inline-closure-captures.rs:+2:5: +2:9 scope 1 { - debug x => _3; // in scope 1 at $DIR/inline-closure-captures.rs:11:9: 11:10 + debug x => _3; // in scope 1 at $DIR/inline-closure-captures.rs:+1:9: +1:10 scope 2 (inlined foo::<T>::{closure#0}) { // at $DIR/inline-closure-captures.rs:12:5: 12:9 - debug _q => _9; // in scope 2 at $DIR/inline-closure-captures.rs:11:14: 11:16 - debug q => (*((*_6).0: &i32)); // in scope 2 at $DIR/inline-closure-captures.rs:10:23: 10:24 - debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:10:17: 10:18 - let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 - let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:17 - let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:17 + debug _q => _9; // in scope 2 at $DIR/inline-closure-captures.rs:+1:14: +1:16 + debug q => (*((*_6).0: &i32)); // in scope 2 at $DIR/inline-closure-captures.rs:+0:23: +0:24 + 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 } } bb0: { - StorageLive(_3); // scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10 - StorageLive(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - _4 = &_2; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - StorageLive(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - _5 = &_1; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - Deinit(_3); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - (_3.0: &i32) = move _4; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - (_3.1: &T) = move _5; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 - StorageDead(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:16: 11:17 - StorageDead(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:16: 11:17 - StorageLive(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6 - _6 = &_3; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6 - StorageLive(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - StorageLive(_8); // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8 - _8 = _2; // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8 - Deinit(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - (_7.0: i32) = move _8; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - StorageLive(_9); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - _9 = move (_7.0: i32); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - StorageLive(_10); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 - StorageLive(_12); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 - _12 = deref_copy ((*_6).0: &i32); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 - _10 = (*_12); // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 - StorageDead(_12); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - StorageLive(_11); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - StorageLive(_13); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - _13 = deref_copy ((*_6).1: &T); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - _11 = (*_13); // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 - StorageDead(_13); // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24 - Deinit(_0); // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24 - (_0.0: i32) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24 - (_0.1: T) = move _11; // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24 - StorageDead(_11); // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24 - StorageDead(_10); // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24 - StorageDead(_9); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 - StorageDead(_8); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9 - StorageDead(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9 - StorageDead(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9 - StorageDead(_3); // scope 0 at $DIR/inline-closure-captures.rs:13:1: 13:2 - return; // scope 0 at $DIR/inline-closure-captures.rs:13:2: 13:2 + StorageLive(_3); // scope 0 at $DIR/inline-closure-captures.rs:+1:9: +1:10 + StorageLive(_4); // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + _4 = &_2; // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + StorageLive(_5); // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + _5 = &_1; // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + Deinit(_3); // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + (_3.0: &i32) = move _4; // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + (_3.1: &T) = move _5; // scope 0 at $DIR/inline-closure-captures.rs:+1:13: +1:24 + StorageDead(_5); // scope 0 at $DIR/inline-closure-captures.rs:+1:16: +1:17 + StorageDead(_4); // scope 0 at $DIR/inline-closure-captures.rs:+1:16: +1:17 + StorageLive(_6); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:6 + _6 = &_3; // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:6 + StorageLive(_7); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9 + StorageLive(_8); // scope 1 at $DIR/inline-closure-captures.rs:+2:7: +2:8 + _8 = _2; // scope 1 at $DIR/inline-closure-captures.rs:+2:7: +2:8 + Deinit(_7); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9 + (_7.0: i32) = move _8; // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9 + 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 + StorageDead(_11); // scope 2 at $DIR/inline-closure-captures.rs:+1:23: +1:24 + StorageDead(_10); // scope 2 at $DIR/inline-closure-captures.rs:+1:23: +1:24 + StorageDead(_9); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9 + StorageDead(_8); // scope 1 at $DIR/inline-closure-captures.rs:+2:8: +2:9 + StorageDead(_7); // scope 1 at $DIR/inline-closure-captures.rs:+2:8: +2:9 + StorageDead(_6); // scope 1 at $DIR/inline-closure-captures.rs:+2:8: +2:9 + StorageDead(_3); // scope 0 at $DIR/inline-closure-captures.rs:+3:1: +3:2 + return; // scope 0 at $DIR/inline-closure-captures.rs:+3:2: +3:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-closure-captures.rs:10:1: 13:2 + resume; // scope 0 at $DIR/inline-closure-captures.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff b/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff index 34762b97c3b..556d587a472 100644 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff +++ b/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff @@ -2,27 +2,27 @@ + // MIR for `inlined_no_sanitize` after Inline fn inlined_no_sanitize() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:23:37: 23:37 - let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:24:5: 24:18 + let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:+0:37: +0:37 + let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 + scope 1 (inlined no_sanitize) { // at $DIR/inline-compatibility.rs:24:5: 24:18 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:24:5: 24:18 -- _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:24:5: 24:18 + StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 +- _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 - // mir::Constant - // + span: $DIR/inline-compatibility.rs:24:5: 24:16 - // + literal: Const { ty: unsafe fn() {no_sanitize}, val: Value(<ZST>) } - } - - bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:24:18: 24:19 - _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:23:37: 25:2 - return; // scope 0 at $DIR/inline-compatibility.rs:25:2: 25:2 + StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:18: +1:19 + _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:+0:37: +2:2 + return; // scope 0 at $DIR/inline-compatibility.rs:+2:2: +2:2 + } + + bb1 (cleanup): { -+ resume; // scope 0 at $DIR/inline-compatibility.rs:23:1: 25:2 ++ resume; // scope 0 at $DIR/inline-compatibility.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff b/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff index fd1e1983d1e..b1ee4307358 100644 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff +++ b/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff @@ -2,27 +2,27 @@ + // MIR for `inlined_target_feature` after Inline fn inlined_target_feature() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:12:40: 12:40 - let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:13:5: 13:21 + let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:+0:40: +0:40 + let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 + scope 1 (inlined target_feature) { // at $DIR/inline-compatibility.rs:13:5: 13:21 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:13:5: 13:21 -- _1 = target_feature() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:13:5: 13:21 + StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 +- _1 = target_feature() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 - // mir::Constant - // + span: $DIR/inline-compatibility.rs:13:5: 13:19 - // + literal: Const { ty: unsafe fn() {target_feature}, val: Value(<ZST>) } - } - - bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:13:21: 13:22 - _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:12:40: 14:2 - return; // scope 0 at $DIR/inline-compatibility.rs:14:2: 14:2 + StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:21: +1:22 + _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:+0:40: +2:2 + return; // scope 0 at $DIR/inline-compatibility.rs:+2:2: +2:2 + } + + bb1 (cleanup): { -+ resume; // scope 0 at $DIR/inline-compatibility.rs:12:1: 14:2 ++ resume; // scope 0 at $DIR/inline-compatibility.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff b/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff index bced3f6fe56..49aea431e46 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff +++ b/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff @@ -2,24 +2,24 @@ + // MIR for `not_inlined_c_variadic` after Inline fn not_inlined_c_variadic() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:41:40: 41:40 - let _1: u32; // in scope 0 at $DIR/inline-compatibility.rs:42:9: 42:10 + let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:+0:40: +0:40 + let _1: u32; // in scope 0 at $DIR/inline-compatibility.rs:+1:9: +1:10 scope 1 { - debug s => _1; // in scope 1 at $DIR/inline-compatibility.rs:42:9: 42:10 + debug s => _1; // in scope 1 at $DIR/inline-compatibility.rs:+1:9: +1:10 } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:42:9: 42:10 - _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> bb1; // scope 0 at $DIR/inline-compatibility.rs:42:13: 42:52 + StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:9: +1:10 + _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> bb1; // scope 0 at $DIR/inline-compatibility.rs:+1:13: +1:52 // mir::Constant // + span: $DIR/inline-compatibility.rs:42:13: 42:16 // + literal: Const { ty: unsafe extern "C" fn(u32, ...) -> u32 {sum}, val: Value(<ZST>) } } bb1: { - _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:41:40: 43:2 - StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:43:1: 43:2 - return; // scope 0 at $DIR/inline-compatibility.rs:43:2: 43:2 + _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:+0:40: +2:2 + StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:+2:1: +2:2 + return; // scope 0 at $DIR/inline-compatibility.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff b/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff index a4989cbfa09..94ce574a94d 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff +++ b/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff @@ -2,21 +2,21 @@ + // MIR for `not_inlined_no_sanitize` after Inline fn not_inlined_no_sanitize() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:28:41: 28:41 - let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:29:5: 29:18 + let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:+0:41: +0:41 + let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:29:5: 29:18 - _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:29:5: 29:18 + StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 + _1 = no_sanitize() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:18 // mir::Constant // + span: $DIR/inline-compatibility.rs:29:5: 29:16 // + literal: Const { ty: unsafe fn() {no_sanitize}, val: Value(<ZST>) } } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:29:18: 29:19 - _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:28:41: 30:2 - return; // scope 0 at $DIR/inline-compatibility.rs:30:2: 30:2 + StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:18: +1:19 + _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:+0:41: +2:2 + return; // scope 0 at $DIR/inline-compatibility.rs:+2:2: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff b/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff index 49dd90c971c..8506e257b3f 100644 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff +++ b/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff @@ -2,21 +2,21 @@ + // MIR for `not_inlined_target_feature` after Inline fn not_inlined_target_feature() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:17:44: 17:44 - let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:18:5: 18:21 + let mut _0: (); // return place in scope 0 at $DIR/inline-compatibility.rs:+0:44: +0:44 + let _1: (); // in scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:18:5: 18:21 - _1 = target_feature() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:18:5: 18:21 + StorageLive(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 + _1 = target_feature() -> bb1; // scope 0 at $DIR/inline-compatibility.rs:+1:5: +1:21 // mir::Constant // + span: $DIR/inline-compatibility.rs:18:5: 18:19 // + literal: Const { ty: unsafe fn() {target_feature}, val: Value(<ZST>) } } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:18:21: 18:22 - _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:17:44: 19:2 - return; // scope 0 at $DIR/inline-compatibility.rs:19:2: 19:2 + StorageDead(_1); // scope 0 at $DIR/inline-compatibility.rs:+1:21: +1:22 + _0 = const (); // scope 0 at $DIR/inline-compatibility.rs:+0:44: +2:2 + return; // scope 0 at $DIR/inline-compatibility.rs:+2:2: +2:2 } } 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 8128797d27e..a6d65928da7 100644 --- a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff @@ -2,8 +2,8 @@ + // MIR for `one` after Inline fn one() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-cycle.rs:13:10: 13:10 - let _1: (); // in scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 + let mut _0: (); // return place in scope 0 at $DIR/inline-cycle.rs:+0:10: +0:10 + let _1: (); // in scope 0 at $DIR/inline-cycle.rs:+1:5: +1:24 + scope 1 (inlined <C as Call>::call) { // at $DIR/inline-cycle.rs:14:5: 14:24 + scope 2 (inlined <A<C> as Call>::call) { // at $DIR/inline-cycle.rs:43:9: 43:23 + scope 3 (inlined <B<C> as Call>::call) { // at $DIR/inline-cycle.rs:28:9: 28:31 @@ -12,9 +12,9 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 -- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 -+ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline-cycle.rs:36:9: 36:28 + 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 // mir::Constant - // + span: $DIR/inline-cycle.rs:14:5: 14:22 + // + span: $DIR/inline-cycle.rs:36:9: 36:26 @@ -22,13 +22,13 @@ } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-cycle.rs:14:24: 14:25 - _0 = const (); // scope 0 at $DIR/inline-cycle.rs:13:10: 15:2 - return; // scope 0 at $DIR/inline-cycle.rs:15:2: 15:2 + StorageDead(_1); // scope 0 at $DIR/inline-cycle.rs:+1:24: +1:25 + _0 = const (); // scope 0 at $DIR/inline-cycle.rs:+0:10: +2:2 + return; // scope 0 at $DIR/inline-cycle.rs:+2:2: +2:2 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/inline-cycle.rs:13:1: 15:2 ++ resume; // scope 0 at $DIR/inline-cycle.rs:+0:1: +2:2 } } 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 29c793d7bd8..0fea4121f8d 100644 --- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff @@ -2,36 +2,36 @@ + // MIR for `two` after Inline fn two() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-cycle.rs:48:10: 48:10 - let _1: (); // in scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 -+ let mut _2: fn() {f}; // in scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 + let mut _0: (); // return place in scope 0 at $DIR/inline-cycle.rs:+0:10: +0:10 + 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: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 ++ 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 + 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:59:5: 59:12 ++ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12 + } + } + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 -- _1 = call::<fn() {f}>(f) -> bb1; // scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 -+ StorageLive(_2); // scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 -+ _2 = f; // scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 + StorageLive(_1); // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12 +- _1 = call::<fn() {f}>(f) -> bb1; // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12 ++ StorageLive(_2); // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12 ++ _2 = f; // scope 0 at $DIR/inline-cycle.rs:+1:5: +1:12 // mir::Constant - // + 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: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 ++ 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 + // mir::Constant + // + span: $DIR/inline-cycle.rs:59:5: 59:9 // + literal: Const { ty: fn(fn() {f}) {call::<fn() {f}>}, val: Value(<ZST>) } @@ -42,18 +42,18 @@ } bb1: { -+ 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:49:5: 49:12 - StorageDead(_1); // scope 0 at $DIR/inline-cycle.rs:49:12: 49:13 - _0 = const (); // scope 0 at $DIR/inline-cycle.rs:48:10: 50:2 - return; // scope 0 at $DIR/inline-cycle.rs:50:2: 50:2 ++ 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(_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 + return; // scope 0 at $DIR/inline-cycle.rs:+2:2: +2:2 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/inline-cycle.rs:48:1: 50:2 ++ resume; // scope 0 at $DIR/inline-cycle.rs:+0:1: +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 2ccd39e7931..d5709f1b47a 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 @@ -2,8 +2,8 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-cycle-generic.rs:8:11: 8:11 - let _1: (); // in scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 + let mut _0: (); // return place in scope 0 at $DIR/inline-cycle-generic.rs:+0:11: +0:11 + let _1: (); // in scope 0 at $DIR/inline-cycle-generic.rs:+1:5: +1:24 + scope 1 (inlined <C as Call>::call) { // at $DIR/inline-cycle-generic.rs:9:5: 9:24 + scope 2 (inlined <B<A> as Call>::call) { // at $DIR/inline-cycle-generic.rs:38:9: 38:31 + scope 3 (inlined <A as Call>::call) { // at $DIR/inline-cycle-generic.rs:31:9: 31:28 @@ -14,9 +14,9 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 -- _1 = <C as Call>::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 -+ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline-cycle-generic.rs:31:9: 31:28 + 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 // mir::Constant - // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22 + // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26 @@ -24,13 +24,13 @@ } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:24: 9:25 - _0 = const (); // scope 0 at $DIR/inline-cycle-generic.rs:8:11: 10:2 - return; // scope 0 at $DIR/inline-cycle-generic.rs:10:2: 10:2 + StorageDead(_1); // scope 0 at $DIR/inline-cycle-generic.rs:+1:24: +1:25 + _0 = const (); // scope 0 at $DIR/inline-cycle-generic.rs:+0:11: +2:2 + return; // scope 0 at $DIR/inline-cycle-generic.rs:+2:2: +2:2 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/inline-cycle-generic.rs:8:1: 10:2 ++ resume; // scope 0 at $DIR/inline-cycle-generic.rs:+0:1: +2:2 } } 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 7cdc1a6b546..7ebc2ff5c45 100644 --- a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff @@ -2,27 +2,27 @@ + // MIR for `f` after Inline fn f() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-diverging.rs:7:12: 7:12 - let mut _1: !; // in scope 0 at $DIR/inline-diverging.rs:7:12: 9:2 - let _2: !; // in scope 0 at $DIR/inline-diverging.rs:8:5: 8:12 + let mut _0: (); // return place in scope 0 at $DIR/inline-diverging.rs:+0:12: +0:12 + let mut _1: !; // in scope 0 at $DIR/inline-diverging.rs:+0:12: +2:2 + let _2: !; // in scope 0 at $DIR/inline-diverging.rs:+1:5: +1:12 + scope 1 (inlined sleep) { // at $DIR/inline-diverging.rs:8:5: 8:12 + } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:8:5: 8:12 -- _2 = sleep(); // scope 0 at $DIR/inline-diverging.rs:8:5: 8:12 + StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:12 +- _2 = sleep(); // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:12 - // mir::Constant - // + span: $DIR/inline-diverging.rs:8:5: 8:10 - // + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) } -+ goto -> bb1; // scope 0 at $DIR/inline-diverging.rs:8:5: 8:12 ++ goto -> bb1; // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:12 + } + + bb1: { -+ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:39:5: 39:12 ++ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:+32:5: +32:12 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/inline-diverging.rs:7:1: 9:2 ++ resume; // scope 0 at $DIR/inline-diverging.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff index 595df0aed5f..acdd0f87901 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -2,38 +2,38 @@ + // MIR for `g` after Inline fn g(_1: i32) -> u32 { - debug i => _1; // in scope 0 at $DIR/inline-diverging.rs:12:10: 12:11 - let mut _0: u32; // return place in scope 0 at $DIR/inline-diverging.rs:12:21: 12:24 - let mut _2: bool; // in scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - let mut _3: i32; // in scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:15:12: 17:6 - let _6: !; // in scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + debug i => _1; // in scope 0 at $DIR/inline-diverging.rs:+0:10: +0:11 + let mut _0: u32; // return place in scope 0 at $DIR/inline-diverging.rs:+0:21: +0:24 + let mut _2: bool; // in scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + let mut _3: i32; // in scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + let mut _4: i32; // in scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + let mut _5: !; // in scope 0 at $DIR/inline-diverging.rs:+3:12: +5:6 + let _6: !; // in scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 + scope 1 (inlined panic) { // at $DIR/inline-diverging.rs:16:9: 16:16 + let mut _7: !; // in scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _3 = _1; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 - _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 - StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 + StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + StorageLive(_3); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + _3 = _1; // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:9 + _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 + StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:+1:12: +1:13 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:+1:8: +1:13 } bb1: { - StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 - StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:17:5: 17:6 - return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 + StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + _4 = _1; // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10 + _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17 + StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:+2:16: +2:17 + StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:+5:5: +5:6 + return; // scope 0 at $DIR/inline-diverging.rs:+6:2: +6:2 } bb2: { - StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 -- _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 +- _6 = panic(); // scope 0 at $DIR/inline-diverging.rs:+4:9: +4:16 + StorageLive(_7); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL + _7 = begin_panic::<&str>(const "explicit panic"); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant @@ -47,7 +47,7 @@ + } + + bb3 (cleanup): { -+ resume; // scope 0 at $DIR/inline-diverging.rs:12:1: 18:2 ++ resume; // scope 0 at $DIR/inline-diverging.rs:+0:1: +6:2 } } 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 32066cf2e3e..8fda8673c95 100644 --- a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff @@ -2,23 +2,23 @@ + // MIR for `h` after Inline fn h() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-diverging.rs:21:12: 21:12 - let _1: (!, !); // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 -+ let mut _2: fn() -> ! {sleep}; // in scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 + let mut _0: (); // return place in scope 0 at $DIR/inline-diverging.rs:+0:12: +0:12 + 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: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 ++ 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 + scope 2 { -+ 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 ++ 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 + scope 3 { -+ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:28:9: 28:10 ++ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:+7:9: +7: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 @@ -32,29 +32,29 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 -- _1 = call_twice::<!, fn() -> ! {sleep}>(sleep); // scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 -+ StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 -+ _2 = sleep; // scope 0 at $DIR/inline-diverging.rs:22:5: 22:22 + StorageLive(_1); // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22 +- _1 = call_twice::<!, fn() -> ! {sleep}>(sleep); // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22 ++ StorageLive(_2); // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22 ++ _2 = sleep; // scope 0 at $DIR/inline-diverging.rs:+1:5: +1:22 // mir::Constant - // + span: $DIR/inline-diverging.rs:22:5: 22:15 - // + literal: Const { ty: fn(fn() -> ! {sleep}) -> (!, !) {call_twice::<!, fn() -> ! {sleep}>}, val: Value(<ZST>) } - // 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: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 ++ 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 + } + + bb1: { -+ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:39:5: 39:12 ++ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:+18:5: +18:12 + } + + bb2 (cleanup): { -+ resume; // scope 0 at $DIR/inline-diverging.rs:21:1: 23:2 ++ resume; // scope 0 at $DIR/inline-diverging.rs:+0:1: +2:2 } } 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 b4f0abd1af5..c7c2759cc65 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -2,14 +2,14 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-generator.rs:8:11: 8:11 - let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11 - let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32 - let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31 - let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31 -+ let mut _7: bool; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + let mut _0: (); // return place in scope 0 at $DIR/inline-generator.rs:+0:11: +0:11 + let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:+1:9: +1:11 + let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>; // in scope 0 at $DIR/inline-generator.rs:+1:14: +1:32 + let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:+1:23: +1:31 + let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:+1:28: +1:31 ++ let mut _7: bool; // in scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 scope 1 { - debug _r => _1; // in scope 1 at $DIR/inline-generator.rs:9:9: 9:11 + debug _r => _1; // in scope 1 at $DIR/inline-generator.rs:+1:9: +1:11 } + scope 2 (inlined g) { // at $DIR/inline-generator.rs:9:28: 9:31 + } @@ -24,33 +24,33 @@ + } + } + 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: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:8 -+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8 ++ 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 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-generator.rs:9:9: 9:11 - StorageLive(_2); // scope 0 at $DIR/inline-generator.rs:9:14: 9:32 - StorageLive(_3); // scope 0 at $DIR/inline-generator.rs:9:23: 9:31 - StorageLive(_4); // scope 0 at $DIR/inline-generator.rs:9:28: 9:31 -- _4 = g() -> bb1; // scope 0 at $DIR/inline-generator.rs:9:28: 9:31 + StorageLive(_1); // scope 0 at $DIR/inline-generator.rs:+1:9: +1:11 + StorageLive(_2); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32 + StorageLive(_3); // scope 0 at $DIR/inline-generator.rs:+1:23: +1:31 + StorageLive(_4); // scope 0 at $DIR/inline-generator.rs:+1:28: +1:31 +- _4 = g() -> bb1; // scope 0 at $DIR/inline-generator.rs:+1:28: +1:31 - // mir::Constant - // + span: $DIR/inline-generator.rs:9:28: 9:29 - // + literal: Const { ty: fn() -> impl Generator<bool> {g}, val: Value(<ZST>) } - } - - bb1: { -+ 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:9:23: 9: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:9:14: 9:32 ++ 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 + _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 - // + span: $DIR/inline-generator.rs:9:14: 9:22 - // + user_ty: UserType(0) @@ -66,91 +66,91 @@ + (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]) = move _6; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL - StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:9:31: 9:32 -- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:+1:31: +1:32 +- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 - // mir::Constant - // + span: $DIR/inline-generator.rs:9:33: 9:39 - // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) } -+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15: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:8 -+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 ++ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46 ++ _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 } - bb3: { + bb1: { -+ StorageDead(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageDead(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 -+ StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 - StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:9:45: 9:46 - StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:9:46: 9:47 - _0 = const (); // scope 0 at $DIR/inline-generator.rs:8:11: 10:2 - StorageDead(_1); // scope 0 at $DIR/inline-generator.rs:10:1: 10:2 - return; // scope 0 at $DIR/inline-generator.rs:10:2: 10:2 ++ 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 + StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:+1:45: +1:46 + StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:+1:46: +1:47 + _0 = const (); // scope 0 at $DIR/inline-generator.rs:+0:11: +2:2 + StorageDead(_1); // scope 0 at $DIR/inline-generator.rs:+2:1: +2:2 + return; // scope 0 at $DIR/inline-generator.rs:+2:2: +2:2 } - bb4 (cleanup): { + bb2 (cleanup): { - resume; // scope 0 at $DIR/inline-generator.rs:8:1: 10:2 + resume; // scope 0 at $DIR/inline-generator.rs:+0:1: +2:2 + } + + bb3: { -+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ 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 ++ _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 + } + + bb4: { -+ _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 ++ _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 + } + + bb5: { -+ _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 ++ _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 + } + + bb6: { -+ 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 -+ StorageLive(_14); // 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 -+ StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 -+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39 ++ 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 + } + + bb7: { -+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 -+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39 -+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8 -+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:8: 15:8 ++ 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 + } + + bb8: { -+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 ++ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8 + } + + bb9: { -+ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8 ++ unreachable; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8 } } diff --git a/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff b/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff index 05bd99b62cd..e3375e9e15c 100644 --- a/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff +++ b/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff @@ -2,47 +2,47 @@ + // MIR for `default` after Inline fn default() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-instruction-set.rs:50:18: 50:18 - let _1: (); // in scope 0 at $DIR/inline-instruction-set.rs:51:5: 51:26 - let _2: (); // in scope 0 at $DIR/inline-instruction-set.rs:52:5: 52:26 - let _3: (); // in scope 0 at $DIR/inline-instruction-set.rs:53:5: 53:30 + let mut _0: (); // return place in scope 0 at $DIR/inline-instruction-set.rs:+0:18: +0:18 + let _1: (); // in scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 + let _2: (); // in scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 + let _3: (); // in scope 0 at $DIR/inline-instruction-set.rs:+3:5: +3:30 + scope 1 (inlined instruction_set_default) { // at $DIR/inline-instruction-set.rs:53:5: 53:30 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-instruction-set.rs:51:5: 51:26 - _1 = instruction_set_a32() -> bb1; // scope 0 at $DIR/inline-instruction-set.rs:51:5: 51:26 + StorageLive(_1); // scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 + _1 = instruction_set_a32() -> bb1; // scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 // mir::Constant // + span: $DIR/inline-instruction-set.rs:51:5: 51:24 // + literal: Const { ty: fn() {instruction_set_a32}, val: Value(<ZST>) } } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-instruction-set.rs:51:26: 51:27 - StorageLive(_2); // scope 0 at $DIR/inline-instruction-set.rs:52:5: 52:26 - _2 = instruction_set_t32() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:52:5: 52:26 + StorageDead(_1); // scope 0 at $DIR/inline-instruction-set.rs:+1:26: +1:27 + StorageLive(_2); // scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 + _2 = instruction_set_t32() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 // mir::Constant // + span: $DIR/inline-instruction-set.rs:52:5: 52:24 // + literal: Const { ty: fn() {instruction_set_t32}, val: Value(<ZST>) } } bb2: { - StorageDead(_2); // scope 0 at $DIR/inline-instruction-set.rs:52:26: 52:27 - StorageLive(_3); // scope 0 at $DIR/inline-instruction-set.rs:53:5: 53:30 -- _3 = instruction_set_default() -> bb3; // scope 0 at $DIR/inline-instruction-set.rs:53:5: 53:30 + StorageDead(_2); // scope 0 at $DIR/inline-instruction-set.rs:+2:26: +2:27 + StorageLive(_3); // scope 0 at $DIR/inline-instruction-set.rs:+3:5: +3:30 +- _3 = instruction_set_default() -> bb3; // scope 0 at $DIR/inline-instruction-set.rs:+3:5: +3:30 - // mir::Constant - // + span: $DIR/inline-instruction-set.rs:53:5: 53:28 - // + literal: Const { ty: fn() {instruction_set_default}, val: Value(<ZST>) } - } - - bb3: { - StorageDead(_3); // scope 0 at $DIR/inline-instruction-set.rs:53:30: 53:31 - _0 = const (); // scope 0 at $DIR/inline-instruction-set.rs:50:18: 54:2 - return; // scope 0 at $DIR/inline-instruction-set.rs:54:2: 54:2 + StorageDead(_3); // scope 0 at $DIR/inline-instruction-set.rs:+3:30: +3:31 + _0 = const (); // scope 0 at $DIR/inline-instruction-set.rs:+0:18: +4:2 + return; // scope 0 at $DIR/inline-instruction-set.rs:+4:2: +4:2 + } + + bb3 (cleanup): { -+ resume; // scope 0 at $DIR/inline-instruction-set.rs:50:1: 54:2 ++ resume; // scope 0 at $DIR/inline-instruction-set.rs:+0:1: +4:2 } } diff --git a/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff b/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff index cb0d01428c9..ce294db02fd 100644 --- a/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff +++ b/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff @@ -2,35 +2,35 @@ + // MIR for `t32` after Inline fn t32() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-instruction-set.rs:41:14: 41:14 - let _1: (); // in scope 0 at $DIR/inline-instruction-set.rs:42:5: 42:26 - let _2: (); // in scope 0 at $DIR/inline-instruction-set.rs:43:5: 43:26 - let _3: (); // in scope 0 at $DIR/inline-instruction-set.rs:46:5: 46:30 + let mut _0: (); // return place in scope 0 at $DIR/inline-instruction-set.rs:+0:14: +0:14 + let _1: (); // in scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 + let _2: (); // in scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 + let _3: (); // in scope 0 at $DIR/inline-instruction-set.rs:+5:5: +5:30 + scope 1 (inlined instruction_set_t32) { // at $DIR/inline-instruction-set.rs:43:5: 43:26 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-instruction-set.rs:42:5: 42:26 - _1 = instruction_set_a32() -> bb1; // scope 0 at $DIR/inline-instruction-set.rs:42:5: 42:26 + StorageLive(_1); // scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 + _1 = instruction_set_a32() -> bb1; // scope 0 at $DIR/inline-instruction-set.rs:+1:5: +1:26 // mir::Constant // + span: $DIR/inline-instruction-set.rs:42:5: 42:24 // + literal: Const { ty: fn() {instruction_set_a32}, val: Value(<ZST>) } } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-instruction-set.rs:42:26: 42:27 - StorageLive(_2); // scope 0 at $DIR/inline-instruction-set.rs:43:5: 43:26 -- _2 = instruction_set_t32() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:43:5: 43:26 + StorageDead(_1); // scope 0 at $DIR/inline-instruction-set.rs:+1:26: +1:27 + StorageLive(_2); // scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 +- _2 = instruction_set_t32() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:+2:5: +2:26 - // mir::Constant - // + span: $DIR/inline-instruction-set.rs:43:5: 43:24 - // + literal: Const { ty: fn() {instruction_set_t32}, val: Value(<ZST>) } - } - - bb2: { - StorageDead(_2); // scope 0 at $DIR/inline-instruction-set.rs:43:26: 43:27 - StorageLive(_3); // scope 0 at $DIR/inline-instruction-set.rs:46:5: 46:30 -- _3 = instruction_set_default() -> bb3; // scope 0 at $DIR/inline-instruction-set.rs:46:5: 46:30 -+ _3 = instruction_set_default() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:46:5: 46:30 + StorageDead(_2); // scope 0 at $DIR/inline-instruction-set.rs:+2:26: +2:27 + StorageLive(_3); // scope 0 at $DIR/inline-instruction-set.rs:+5:5: +5:30 +- _3 = instruction_set_default() -> bb3; // scope 0 at $DIR/inline-instruction-set.rs:+5:5: +5:30 ++ _3 = instruction_set_default() -> bb2; // scope 0 at $DIR/inline-instruction-set.rs:+5:5: +5:30 // mir::Constant // + span: $DIR/inline-instruction-set.rs:46:5: 46:28 // + literal: Const { ty: fn() {instruction_set_default}, val: Value(<ZST>) } @@ -38,13 +38,13 @@ - bb3: { + bb2: { - StorageDead(_3); // scope 0 at $DIR/inline-instruction-set.rs:46:30: 46:31 - _0 = const (); // scope 0 at $DIR/inline-instruction-set.rs:41:14: 47:2 - return; // scope 0 at $DIR/inline-instruction-set.rs:47:2: 47:2 + StorageDead(_3); // scope 0 at $DIR/inline-instruction-set.rs:+5:30: +5:31 + _0 = const (); // scope 0 at $DIR/inline-instruction-set.rs:+0:14: +6:2 + return; // scope 0 at $DIR/inline-instruction-set.rs:+6:2: +6:2 + } + + bb3 (cleanup): { -+ resume; // scope 0 at $DIR/inline-instruction-set.rs:41:1: 47:2 ++ resume; // scope 0 at $DIR/inline-instruction-set.rs:+0:1: +6:2 } } 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 index 17050f184cb..deaba70e082 100644 --- 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 @@ -2,18 +2,18 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11 - let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 - let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _8: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + 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:8:9: 8:11 + debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:+1:9: +1:11 } scope 2 { } @@ -22,23 +22,23 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 - _2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 - _3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 - _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 + 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:8:29: 8:43 - _5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8: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:8:33: 8:43 -- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 -+ StorageLive(_9); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 -+ _9 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + 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 @@ -55,24 +55,24 @@ + ((*_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:8:33: 8:43 - StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 - _1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 ++ 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:9:1: 9:2 - return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 + 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:8:33: 8: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:8:42: 8:43 +- 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>) } @@ -80,7 +80,7 @@ - - bb5 (cleanup): { + bb3 (cleanup): { - resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + 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.64bit.diff index 17050f184cb..deaba70e082 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.64bit.diff @@ -2,18 +2,18 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11 - let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 - let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - let mut _8: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 -+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + 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:8:9: 8:11 + debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:+1:9: +1:11 } scope 2 { } @@ -22,23 +22,23 @@ + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11 - _2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 - _3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 - _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43 + 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:8:29: 8:43 - _5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8: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:8:33: 8:43 -- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 -+ StorageLive(_9); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 -+ _9 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 + 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 @@ -55,24 +55,24 @@ + ((*_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:8:33: 8:43 - StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43 - _1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43 - StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43 - _0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2 -- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 -+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2 ++ 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:9:1: 9:2 - return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2 + 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:8:33: 8: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:8:42: 8:43 +- 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>) } @@ -80,7 +80,7 @@ - - bb5 (cleanup): { + bb3 (cleanup): { - resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2 + resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2 } } 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 45023083be6..49c72b7196c 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 @@ -1,59 +1,59 @@ // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-options.rs:8:11: 8:11 - let _1: (); // in scope 0 at $DIR/inline-options.rs:9:5: 9:18 - let _2: (); // in scope 0 at $DIR/inline-options.rs:10:5: 10:21 + let mut _0: (); // return place in scope 0 at $DIR/inline-options.rs:+0:11: +0:11 + 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: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 + 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 } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-options.rs:9:5: 9:18 - _1 = not_inlined() -> bb1; // scope 0 at $DIR/inline-options.rs:9:5: 9:18 + StorageLive(_1); // scope 0 at $DIR/inline-options.rs:+1:5: +1:18 + _1 = not_inlined() -> bb1; // scope 0 at $DIR/inline-options.rs:+1:5: +1:18 // mir::Constant // + span: $DIR/inline-options.rs:9:5: 9:16 // + literal: Const { ty: fn() {not_inlined}, val: Value(<ZST>) } } bb1: { - StorageDead(_1); // scope 0 at $DIR/inline-options.rs:9:18: 9:19 - StorageLive(_2); // scope 0 at $DIR/inline-options.rs:10:5: 10:21 - 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 + 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 // 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: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 + 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 // 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: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 + 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 // 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:16:36: 16:37 - StorageDead(_2); // scope 0 at $DIR/inline-options.rs:10:21: 10:22 - _0 = const (); // scope 0 at $DIR/inline-options.rs:8:11: 11:2 - return; // scope 0 at $DIR/inline-options.rs:11:2: 11:2 + StorageDead(_5); // scope 1 at $DIR/inline-options.rs:+8:36: +8: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 } bb5 (cleanup): { - resume; // scope 0 at $DIR/inline-options.rs:8:1: 11:2 + resume; // scope 0 at $DIR/inline-options.rs:+0:1: +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 fcc1767578e..0ea8823156c 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 @@ -1,76 +1,76 @@ // MIR for `bar` after Inline fn bar() -> bool { - let mut _0: bool; // return place in scope 0 at $DIR/inline-retag.rs:10:13: 10:17 - let _1: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:11:9: 11:10 - let mut _2: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:12:5: 12:6 - let mut _3: &i32; // in scope 0 at $DIR/inline-retag.rs:12:7: 12:9 - let _4: &i32; // in scope 0 at $DIR/inline-retag.rs:12:7: 12:9 - let _5: i32; // in scope 0 at $DIR/inline-retag.rs:12:8: 12:9 - let mut _6: &i32; // in scope 0 at $DIR/inline-retag.rs:12:11: 12:14 - let _7: &i32; // in scope 0 at $DIR/inline-retag.rs:12:11: 12:14 - let _8: i32; // in scope 0 at $DIR/inline-retag.rs:12:12: 12:14 + let mut _0: bool; // return place in scope 0 at $DIR/inline-retag.rs:+0:13: +0:17 + let _1: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+1:9: +1:10 + let mut _2: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+2:5: +2:6 + let mut _3: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9 + let _4: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9 + let _5: i32; // in scope 0 at $DIR/inline-retag.rs:+2:8: +2:9 + let mut _6: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:11: +2:14 + let _7: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:11: +2:14 + let _8: i32; // in scope 0 at $DIR/inline-retag.rs:+2:12: +2:14 scope 1 { - debug f => _1; // in scope 1 at $DIR/inline-retag.rs:11:9: 11:10 - let mut _9: &i32; // in scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - let mut _10: &i32; // in scope 1 at $DIR/inline-retag.rs:12:7: 12:9 + debug f => _1; // in scope 1 at $DIR/inline-retag.rs:+1:9: +1:10 + 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: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 + 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 } } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-retag.rs:11:9: 11:10 - _1 = foo; // scope 0 at $DIR/inline-retag.rs:11:13: 11:16 + StorageLive(_1); // scope 0 at $DIR/inline-retag.rs:+1:9: +1:10 + _1 = foo; // scope 0 at $DIR/inline-retag.rs:+1:13: +1:16 // mir::Constant // + span: $DIR/inline-retag.rs:11:13: 11:16 // + literal: Const { ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}, val: Value(<ZST>) } - StorageLive(_2); // scope 1 at $DIR/inline-retag.rs:12:5: 12:6 - _2 = _1; // scope 1 at $DIR/inline-retag.rs:12:5: 12:6 - StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - StorageLive(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - _10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 + StorageLive(_2); // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6 + _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 // mir::Constant // + span: $DIR/inline-retag.rs:12:7: 12:9 // + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[1])) } - Retag(_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - _4 = &(*_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - Retag(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - _3 = &(*_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - Retag(_3); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9 - StorageLive(_6); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - StorageLive(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - _9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 + Retag(_10); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9 + _4 = &(*_10); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9 + Retag(_4); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9 + _3 = &(*_4); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9 + 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 // mir::Constant // + span: $DIR/inline-retag.rs:12:11: 12:14 // + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[0])) } - Retag(_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - _7 = &(*_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - Retag(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - _6 = &(*_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - Retag(_6); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14 - Retag(_3); // scope 2 at $DIR/inline-retag.rs:16:1: 18:2 - Retag(_6); // scope 2 at $DIR/inline-retag.rs:16:1: 18:2 - 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:12:14: 12:15 - StorageDead(_3); // scope 1 at $DIR/inline-retag.rs:12:14: 12:15 - StorageDead(_2); // scope 1 at $DIR/inline-retag.rs:12:14: 12:15 - StorageDead(_1); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2 - StorageDead(_7); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2 - StorageDead(_4); // scope 0 at $DIR/inline-retag.rs:13:1: 13:2 - return; // scope 0 at $DIR/inline-retag.rs:13:2: 13:2 + Retag(_9); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14 + _7 = &(*_9); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14 + 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 + 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 + StorageDead(_1); // scope 0 at $DIR/inline-retag.rs:+3:1: +3:2 + StorageDead(_7); // scope 0 at $DIR/inline-retag.rs:+3:1: +3:2 + StorageDead(_4); // scope 0 at $DIR/inline-retag.rs:+3:1: +3:2 + return; // scope 0 at $DIR/inline-retag.rs:+3:2: +3:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/inline-retag.rs:10:1: 13:2 + resume; // scope 0 at $DIR/inline-retag.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff index d67b07b0181..e69af791622 100644 --- a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff +++ b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff @@ -2,16 +2,16 @@ + // MIR for `clone` after Inline fn clone(_1: fn(A, B)) -> fn(A, B) { - debug f => _1; // in scope 0 at $DIR/inline-shims.rs:5:20: 5:21 - let mut _0: fn(A, B); // return place in scope 0 at $DIR/inline-shims.rs:5:36: 5:44 - let mut _2: &fn(A, B); // in scope 0 at $DIR/inline-shims.rs:6:5: 6:14 + debug f => _1; // in scope 0 at $DIR/inline-shims.rs:+0:20: +0:21 + let mut _0: fn(A, B); // return place in scope 0 at $DIR/inline-shims.rs:+0:36: +0:44 + let mut _2: &fn(A, B); // in scope 0 at $DIR/inline-shims.rs:+1:5: +1:14 + scope 1 (inlined <fn(A, B) as Clone>::clone - shim(fn(A, B))) { // at $DIR/inline-shims.rs:6:5: 6:14 + } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-shims.rs:6:5: 6:14 - _2 = &_1; // scope 0 at $DIR/inline-shims.rs:6:5: 6:14 -- _0 = <fn(A, B) as Clone>::clone(move _2) -> bb1; // scope 0 at $DIR/inline-shims.rs:6:5: 6:14 + StorageLive(_2); // scope 0 at $DIR/inline-shims.rs:+1:5: +1:14 + _2 = &_1; // scope 0 at $DIR/inline-shims.rs:+1:5: +1:14 +- _0 = <fn(A, B) as Clone>::clone(move _2) -> bb1; // scope 0 at $DIR/inline-shims.rs:+1:5: +1:14 - // mir::Constant - // + span: $DIR/inline-shims.rs:6:7: 6:12 - // + literal: Const { ty: for<'r> fn(&'r fn(A, B)) -> fn(A, B) {<fn(A, B) as Clone>::clone}, val: Value(<ZST>) } @@ -19,12 +19,12 @@ - - bb1: { + _0 = (*_2); // scope 1 at $SRC_DIR/core/src/clone.rs:LL:COL - StorageDead(_2); // scope 0 at $DIR/inline-shims.rs:6:13: 6:14 - return; // scope 0 at $DIR/inline-shims.rs:7:2: 7:2 + StorageDead(_2); // scope 0 at $DIR/inline-shims.rs:+1:13: +1:14 + return; // scope 0 at $DIR/inline-shims.rs:+2:2: +2:2 + } + + bb1 (cleanup): { -+ resume; // scope 0 at $DIR/inline-shims.rs:5:1: 7:2 ++ resume; // scope 0 at $DIR/inline-shims.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff b/src/test/mir-opt/inline/inline_shims.drop.Inline.diff index 5c7cbc9b419..8c1c383ee25 100644 --- a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff +++ b/src/test/mir-opt/inline/inline_shims.drop.Inline.diff @@ -2,12 +2,12 @@ + // MIR for `drop` after Inline fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () { - debug a => _1; // in scope 0 at $DIR/inline-shims.rs:10:19: 10:20 - debug b => _2; // in scope 0 at $DIR/inline-shims.rs:10:35: 10:36 - let mut _0: (); // return place in scope 0 at $DIR/inline-shims.rs:10:54: 10:54 - let _3: (); // in scope 0 at $DIR/inline-shims.rs:11:14: 11:40 - let mut _4: *mut std::vec::Vec<A>; // in scope 0 at $DIR/inline-shims.rs:11:38: 11:39 - let mut _5: *mut std::option::Option<B>; // in scope 0 at $DIR/inline-shims.rs:12:38: 12:39 + debug a => _1; // in scope 0 at $DIR/inline-shims.rs:+0:19: +0:20 + debug b => _2; // in scope 0 at $DIR/inline-shims.rs:+0:35: +0:36 + let mut _0: (); // return place in scope 0 at $DIR/inline-shims.rs:+0:54: +0:54 + let _3: (); // in scope 0 at $DIR/inline-shims.rs:+1:14: +1:40 + let mut _4: *mut std::vec::Vec<A>; // in scope 0 at $DIR/inline-shims.rs:+1:38: +1:39 + let mut _5: *mut std::option::Option<B>; // in scope 0 at $DIR/inline-shims.rs:+2:38: +2:39 scope 1 { } scope 2 { @@ -18,35 +18,35 @@ } bb0: { - StorageLive(_3); // scope 0 at $DIR/inline-shims.rs:11:5: 11:42 - StorageLive(_4); // scope 1 at $DIR/inline-shims.rs:11:38: 11:39 - _4 = _1; // scope 1 at $DIR/inline-shims.rs:11:38: 11:39 - _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline-shims.rs:11:14: 11:40 + StorageLive(_3); // scope 0 at $DIR/inline-shims.rs:+1:5: +1:42 + StorageLive(_4); // scope 1 at $DIR/inline-shims.rs:+1:38: +1:39 + _4 = _1; // scope 1 at $DIR/inline-shims.rs:+1:38: +1:39 + _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline-shims.rs:+1:14: +1:40 // mir::Constant // + span: $DIR/inline-shims.rs:11:14: 11:37 // + literal: Const { ty: unsafe fn(*mut Vec<A>) {std::ptr::drop_in_place::<Vec<A>>}, val: Value(<ZST>) } } bb1: { - StorageDead(_4); // scope 1 at $DIR/inline-shims.rs:11:39: 11:40 - StorageDead(_3); // scope 0 at $DIR/inline-shims.rs:11:41: 11:42 - StorageLive(_5); // scope 2 at $DIR/inline-shims.rs:12:38: 12:39 - _5 = _2; // scope 2 at $DIR/inline-shims.rs:12:38: 12:39 -- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 + StorageDead(_4); // scope 1 at $DIR/inline-shims.rs:+1:39: +1:40 + StorageDead(_3); // scope 0 at $DIR/inline-shims.rs:+1:41: +1:42 + StorageLive(_5); // scope 2 at $DIR/inline-shims.rs:+2:38: +2:39 + _5 = _2; // scope 2 at $DIR/inline-shims.rs:+2:38: +2:39 +- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline-shims.rs:+2:14: +2:40 - // mir::Constant - // + span: $DIR/inline-shims.rs:12:14: 12:37 - // + literal: Const { ty: unsafe fn(*mut Option<B>) {std::ptr::drop_in_place::<Option<B>>}, val: Value(<ZST>) } -+ StorageLive(_6); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 -+ StorageLive(_7); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 ++ StorageLive(_6); // scope 2 at $DIR/inline-shims.rs:+2:14: +2:40 ++ StorageLive(_7); // scope 2 at $DIR/inline-shims.rs:+2:14: +2:40 + _6 = discriminant((*_5)); // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + switchInt(move _6) -> [0_isize: bb2, otherwise: bb3]; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL } bb2: { -+ StorageDead(_7); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 -+ StorageDead(_6); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 - StorageDead(_5); // scope 2 at $DIR/inline-shims.rs:12:39: 12:40 - return; // scope 0 at $DIR/inline-shims.rs:13:2: 13:2 ++ StorageDead(_7); // scope 2 at $DIR/inline-shims.rs:+2:14: +2:40 ++ StorageDead(_6); // scope 2 at $DIR/inline-shims.rs:+2:14: +2:40 + StorageDead(_5); // scope 2 at $DIR/inline-shims.rs:+2:39: +2:40 + return; // scope 0 at $DIR/inline-shims.rs:+3:2: +3:2 + } + + bb3: { @@ -54,7 +54,7 @@ + } + + bb4 (cleanup): { -+ resume; // scope 0 at $DIR/inline-shims.rs:10:1: 13:2 ++ resume; // scope 0 at $DIR/inline-shims.rs:+0:1: +3:2 } } 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 747eeb98450..6c71311c7d4 100644 --- a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff @@ -2,31 +2,31 @@ + // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline-specialization.rs:4:11: 4:11 - let _1: u32; // in scope 0 at $DIR/inline-specialization.rs:5:9: 5:10 + let mut _0: (); // return place in scope 0 at $DIR/inline-specialization.rs:+0:11: +0:11 + let _1: u32; // in scope 0 at $DIR/inline-specialization.rs:+1:9: +1:10 scope 1 { - debug x => _1; // in scope 1 at $DIR/inline-specialization.rs:5:9: 5:10 + debug x => _1; // in scope 1 at $DIR/inline-specialization.rs:+1:9: +1:10 } + scope 2 (inlined <Vec<()> as Foo>::bar) { // at $DIR/inline-specialization.rs:5:13: 5:38 + } bb0: { - StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10 -- _1 = <Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38 + StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:+1:9: +1:10 +- _1 = <Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:+1:13: +1:38 - // mir::Constant - // + span: $DIR/inline-specialization.rs:5:13: 5:36 - // + literal: Const { ty: fn() -> u32 {<Vec<()> as Foo>::bar}, val: Value(<ZST>) } - } - - bb1: { -+ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34 - _0 = const (); // scope 0 at $DIR/inline-specialization.rs:4:11: 6:2 - StorageDead(_1); // scope 0 at $DIR/inline-specialization.rs:6:1: 6:2 - return; // scope 0 at $DIR/inline-specialization.rs:6:2: 6:2 ++ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:+10:31: +10: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 + } + + bb1 (cleanup): { -+ resume; // scope 0 at $DIR/inline-specialization.rs:4:1: 6:2 ++ resume; // scope 0 at $DIR/inline-specialization.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir index 1646de9289a..ed95edd16ce 100644 --- a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir +++ b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir @@ -1,21 +1,21 @@ // MIR for `test` after Inline fn test(_1: &dyn X) -> u32 { - debug x => _1; // in scope 0 at $DIR/inline-trait-method.rs:8:9: 8:10 - let mut _0: u32; // return place in scope 0 at $DIR/inline-trait-method.rs:8:23: 8:26 - let mut _2: &dyn X; // in scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10 + debug x => _1; // in scope 0 at $DIR/inline-trait-method.rs:+0:9: +0:10 + let mut _0: u32; // return place in scope 0 at $DIR/inline-trait-method.rs:+0:23: +0:26 + let mut _2: &dyn X; // in scope 0 at $DIR/inline-trait-method.rs:+1:5: +1:10 bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10 - _2 = &(*_1); // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10 - _0 = <dyn X as X>::y(move _2) -> bb1; // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10 + StorageLive(_2); // scope 0 at $DIR/inline-trait-method.rs:+1:5: +1:10 + _2 = &(*_1); // scope 0 at $DIR/inline-trait-method.rs:+1:5: +1:10 + _0 = <dyn X as X>::y(move _2) -> bb1; // scope 0 at $DIR/inline-trait-method.rs:+1:5: +1:10 // mir::Constant // + span: $DIR/inline-trait-method.rs:9:7: 9:8 // + literal: Const { ty: for<'r> fn(&'r dyn X) -> u32 {<dyn X as X>::y}, val: Value(<ZST>) } } bb1: { - StorageDead(_2); // scope 0 at $DIR/inline-trait-method.rs:9:9: 9:10 - return; // scope 0 at $DIR/inline-trait-method.rs:10:2: 10:2 + StorageDead(_2); // scope 0 at $DIR/inline-trait-method.rs:+1:9: +1:10 + return; // scope 0 at $DIR/inline-trait-method.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 eb6c09c1cd7..36875d07ca4 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 @@ -1,36 +1,36 @@ // MIR for `test2` after Inline fn test2(_1: &dyn X) -> bool { - debug x => _1; // in scope 0 at $DIR/inline-trait-method_2.rs:4:10: 4:11 - let mut _0: bool; // return place in scope 0 at $DIR/inline-trait-method_2.rs:4:24: 4:28 - let mut _2: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - let mut _3: &dyn X; // in scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 + debug x => _1; // in scope 0 at $DIR/inline-trait-method_2.rs:+0:10: +0:11 + let mut _0: bool; // return place in scope 0 at $DIR/inline-trait-method_2.rs:+0:24: +0:28 + 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:9:9: 9:10 - let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10 + 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 } bb0: { - StorageLive(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - StorageLive(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - _3 = &(*_1); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - _2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - StorageDead(_3); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11 - 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 + StorageLive(_2); // scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11 + StorageLive(_3); // scope 0 at $DIR/inline-trait-method_2.rs:+1:10: +1:11 + _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 // 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:10:9: 10:10 - StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12 - return; // scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2 + StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:+6:9: +6: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 } bb2 (cleanup): { - resume; // scope 0 at $DIR/inline-trait-method_2.rs:4:1: 6:2 + resume; // scope 0 at $DIR/inline-trait-method_2.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir index 56a23cde0c7..e715ff83598 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir +++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir @@ -1,34 +1,34 @@ // MIR for `a` after Inline fn a(_1: &mut [T]) -> &mut [T] { - debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:13: 2:14 - let mut _0: &mut [T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:29: 2:37 - let mut _2: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - let mut _3: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - let mut _4: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 + debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:13: +0:14 + let mut _0: &mut [T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:29: +0:37 + let mut _2: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _3: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _4: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) { // at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 debug self => _4; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL let mut _5: &mut [T]; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - _4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 + 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 + StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + _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/core/src/convert/mod.rs:LL:COL _5 = &mut (*_4); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL _3 = &mut (*_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL StorageDead(_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL - _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:14: 3:15 - _0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 - StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2 - StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2 - return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:2: 4:2 + _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:14: +1:15 + _0 = &mut (*_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:+2:1: +2:2 + StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:1: +2:2 + return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:2: +2:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:1: 4:2 + resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:1: +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 b45dfb17bfe..8bacced23bd 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 @@ -1,11 +1,11 @@ // MIR for `b` after Inline fn b(_1: &mut Box<T>) -> &mut T { - debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:13: 7:14 - let mut _0: &mut T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:32: 7:38 - let mut _2: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - let mut _3: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 + debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:13: +0:14 + let mut _0: &mut T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:32: +0:38 + let mut _2: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _3: &mut T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 debug self => _4; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _5: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -15,10 +15,10 @@ fn b(_1: &mut Box<T>) -> &mut T { } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - _4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 + 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 + StorageLive(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + _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 @@ -32,15 +32,15 @@ fn b(_1: &mut Box<T>) -> &mut T { _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 StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:14: 8:15 - _0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15 - StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2 - StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:2: 9:2 + _2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:14: +1:15 + _0 = &mut (*_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:+2:1: +2:2 + StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:1: +2:2 + return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:2: +2:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:1: 9:2 + resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir index 326b2ad71c0..233a1788288 100644 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir +++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir @@ -1,26 +1,26 @@ // MIR for `c` after Inline fn c(_1: &[T]) -> &[T] { - debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:13: 12:14 - let mut _0: &[T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:25: 12:29 - let _2: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 - let mut _3: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 + debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:13: +0:14 + let mut _0: &[T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:25: +0:29 + let _2: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _3: &[T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 scope 1 (inlined <[T] as AsRef<[T]>>::as_ref) { // at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 debug self => _3; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 - StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 - _3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 + 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 _2 = _3; // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL - _0 = &(*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15 - StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:14: 13:15 - StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:1: 14:2 - return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:2: 14:2 + _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 + return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:2: +2:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:1: 14:2 + resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:1: +2:2 } } 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 4e8547419ae..5b4aeee9e2b 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 @@ -1,10 +1,10 @@ // MIR for `d` after Inline fn d(_1: &Box<T>) -> &T { - debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:13: 17:14 - let mut _0: &T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:28: 17:30 - let _2: &T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 - let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 + debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:13: +0:14 + let mut _0: &T; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:28: +0:30 + let _2: &T; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 + let mut _3: &std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15 scope 1 (inlined <Box<T> as AsRef<T>>::as_ref) { // at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 debug self => _3; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL let mut _4: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -12,9 +12,9 @@ fn d(_1: &Box<T>) -> &T { } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 - StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 - _3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15 + 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 @@ -22,13 +22,13 @@ fn d(_1: &Box<T>) -> &T { _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:18:5: 18:15 - StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:14: 18:15 - StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:1: 19:2 - return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:2: 19:2 + _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 + return; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:2: +2:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:1: 19:2 + resume; // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+0:1: +2:2 } } diff --git a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir b/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir index 242073574f2..769ff89fdb7 100644 --- a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir +++ b/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir @@ -1,46 +1,46 @@ // MIR for `main` after Inline fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:4:11: 4:11 - let _1: [closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:5:9: 5:10 - let mut _2: &[closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:6 - let mut _3: ((),); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - let mut _4: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:7: 6:9 - let mut _5: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 + let mut _0: (); // return place in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+0:11: +0:11 + let _1: [closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:9: +1:10 + let mut _2: &[closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:6 + let mut _3: ((),); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + let mut _4: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:7: +2:9 + let mut _5: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 scope 1 { - debug f => _1; // in scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:5:9: 5:10 + debug f => _1; // in scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:9: +1:10 scope 2 (inlined main::{closure#0}) { // at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - debug x => _5; // in scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:5:14: 5:15 - let _6: (); // in scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:5:23: 5:24 + debug x => _5; // in scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:14: +1:15 + let _6: (); // in scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:23: +1:24 scope 3 { - debug y => _6; // in scope 3 at $DIR/issue-76997-inline-scopes-parenting.rs:5:23: 5:24 + debug y => _6; // in scope 3 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:23: +1:24 } } } bb0: { - StorageLive(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:5:9: 5:10 - Deinit(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:33 - StorageLive(_2); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:6 - _2 = &_1; // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:6 - StorageLive(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - StorageLive(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:7: 6:9 - Deinit(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:7: 6:9 - Deinit(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - (_3.0: ()) = move _4; // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - StorageLive(_5); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - _5 = move (_3.0: ()); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - StorageLive(_6); // scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:5:23: 5:24 - StorageDead(_6); // scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:5:32: 5:33 - StorageDead(_5); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 - StorageDead(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:9: 6:10 - StorageDead(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:9: 6:10 - StorageDead(_2); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:6:9: 6:10 - StorageDead(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:7:1: 7:2 - return; // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:7:2: 7:2 + StorageLive(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:9: +1:10 + Deinit(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:13: +1:33 + StorageLive(_2); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:6 + _2 = &_1; // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:6 + StorageLive(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + StorageLive(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:7: +2:9 + Deinit(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:7: +2:9 + Deinit(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + (_3.0: ()) = move _4; // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + StorageLive(_5); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + _5 = move (_3.0: ()); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + StorageLive(_6); // scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:23: +1:24 + StorageDead(_6); // scope 2 at $DIR/issue-76997-inline-scopes-parenting.rs:+1:32: +1:33 + StorageDead(_5); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:5: +2:10 + StorageDead(_4); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:9: +2:10 + StorageDead(_3); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:9: +2:10 + StorageDead(_2); // scope 1 at $DIR/issue-76997-inline-scopes-parenting.rs:+2:9: +2:10 + StorageDead(_1); // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+3:1: +3:2 + return; // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+3:2: +3:2 } bb1 (cleanup): { - resume; // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:4:1: 7:2 + resume; // scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:+0:1: +3:2 } } diff --git a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff index f91d3526226..c16dfdf395e 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff +++ b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff @@ -2,31 +2,31 @@ + // MIR for `bar` after Inline fn bar(_1: P) -> () { - debug _baz => _1; // in scope 0 at $DIR/issue-78442.rs:9:5: 9:9 - let mut _0: (); // return place in scope 0 at $DIR/issue-78442.rs:10:3: 10:3 - let _2: (); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:17 - let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - let _4: fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - let mut _5: (); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:17 + debug _baz => _1; // in scope 0 at $DIR/issue-78442.rs:+2:5: +2:9 + let mut _0: (); // return place in scope 0 at $DIR/issue-78442.rs:+3:3: +3:3 + let _2: (); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + let _4: fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + let mut _5: (); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + scope 1 (inlined <fn() {foo} as Fn<()>>::call - shim(fn() {foo})) { // at $DIR/issue-78442.rs:11:5: 11:17 + } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 - StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 -- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 -+ _4 = hide_foo() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 + StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 +- _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 ++ _4 = hide_foo() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 // mir::Constant // + span: $DIR/issue-78442.rs:11:5: 11:13 // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) } } bb1: { - _3 = &_4; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 - Deinit(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 -- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 + _3 = &_4; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + Deinit(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 +- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 - // mir::Constant - // + span: $DIR/issue-78442.rs:11:5: 11:15 - // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) } @@ -34,35 +34,35 @@ } bb2: { -- StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 -- StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 -- StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 -- StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 -- _0 = const (); // scope 0 at $DIR/issue-78442.rs:10:3: 12:2 -- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 -+ return; // scope 0 at $DIR/issue-78442.rs:12:2: 12:2 +- StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 +- StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 +- StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 +- StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 +- _0 = const (); // scope 0 at $DIR/issue-78442.rs:+3:3: +5:2 +- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 ++ return; // scope 0 at $DIR/issue-78442.rs:+5:2: +5:2 } - bb3: { -- return; // scope 0 at $DIR/issue-78442.rs:12:2: 12:2 +- return; // scope 0 at $DIR/issue-78442.rs:+5:2: +5:2 + bb3 (cleanup): { -+ drop(_1) -> bb4; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 ++ drop(_1) -> bb4; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 } bb4 (cleanup): { -- drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 -+ resume; // scope 0 at $DIR/issue-78442.rs:7:1: 12:2 +- drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 ++ resume; // scope 0 at $DIR/issue-78442.rs:+0:1: +5:2 } - bb5 (cleanup): { -- resume; // scope 0 at $DIR/issue-78442.rs:7:1: 12:2 +- resume; // scope 0 at $DIR/issue-78442.rs:+0:1: +5:2 + bb5: { -+ StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 -+ StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 -+ StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 -+ StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 -+ _0 = const (); // scope 0 at $DIR/issue-78442.rs:10:3: 12:2 -+ drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 ++ StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 ++ StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 ++ StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 ++ StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 ++ _0 = const (); // scope 0 at $DIR/issue-78442.rs:+3:3: +5:2 ++ drop(_1) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 } } diff --git a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff index 4446280e720..0faa522cbaa 100644 --- a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff +++ b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff @@ -2,31 +2,31 @@ + // MIR for `bar` after RevealAll fn bar(_1: P) -> () { - debug _baz => _1; // in scope 0 at $DIR/issue-78442.rs:9:5: 9:9 - let mut _0: (); // return place in scope 0 at $DIR/issue-78442.rs:10:3: 10:3 - let _2: (); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:17 -- let mut _3: &impl Fn(); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 -- let _4: impl Fn(); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 -+ let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 -+ let _4: fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - let mut _5: (); // in scope 0 at $DIR/issue-78442.rs:11:5: 11:17 + debug _baz => _1; // in scope 0 at $DIR/issue-78442.rs:+2:5: +2:9 + let mut _0: (); // return place in scope 0 at $DIR/issue-78442.rs:+3:3: +3:3 + let _2: (); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 +- let mut _3: &impl Fn(); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 +- let _4: impl Fn(); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 ++ let mut _3: &fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 ++ let _4: fn() {foo}; // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + let mut _5: (); // in scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 bb0: { - StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 - StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 + StorageLive(_2); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + StorageLive(_3); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + StorageLive(_4); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + _4 = hide_foo() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 // mir::Constant // + span: $DIR/issue-78442.rs:11:5: 11:13 // + literal: Const { ty: fn() -> impl Fn() {hide_foo}, val: Value(<ZST>) } } bb1: { - _3 = &_4; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15 - StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 - Deinit(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 -- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 -+ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17 + _3 = &_4; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:15 + StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 + Deinit(_5); // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 +- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 ++ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17 // mir::Constant // + span: $DIR/issue-78442.rs:11:5: 11:15 - // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) } @@ -34,24 +34,24 @@ } bb2: { - StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 - StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:11:16: 11:17 - StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 - StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:11:17: 11:18 - _0 = const (); // scope 0 at $DIR/issue-78442.rs:10:3: 12:2 - drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 + StorageDead(_5); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 + StorageDead(_3); // scope 0 at $DIR/issue-78442.rs:+4:16: +4:17 + StorageDead(_4); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 + StorageDead(_2); // scope 0 at $DIR/issue-78442.rs:+4:17: +4:18 + _0 = const (); // scope 0 at $DIR/issue-78442.rs:+3:3: +5:2 + drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 } bb3: { - return; // scope 0 at $DIR/issue-78442.rs:12:2: 12:2 + return; // scope 0 at $DIR/issue-78442.rs:+5:2: +5:2 } bb4 (cleanup): { - drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:12:1: 12:2 + drop(_1) -> bb5; // scope 0 at $DIR/issue-78442.rs:+5:1: +5:2 } bb5 (cleanup): { - resume; // scope 0 at $DIR/issue-78442.rs:7:1: 12:2 + resume; // scope 0 at $DIR/issue-78442.rs:+0:1: +5:2 } } |
