From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../mir-opt/inline/asm_unwind.main.Inline.diff | 45 ------- src/test/mir-opt/inline/asm_unwind.rs | 22 ---- .../caller_with_trivial_bound.foo.Inline.diff | 33 ----- .../mir-opt/inline/caller_with_trivial_bound.rs | 26 ---- src/test/mir-opt/inline/cycle.f.Inline.diff | 43 ------- src/test/mir-opt/inline/cycle.g.Inline.diff | 58 --------- src/test/mir-opt/inline/cycle.main.Inline.diff | 58 --------- src/test/mir-opt/inline/cycle.rs | 18 --- .../mir-opt/inline/dyn_trait.get_query.Inline.diff | 54 -------- .../mir-opt/inline/dyn_trait.mk_cycle.Inline.diff | 23 ---- src/test/mir-opt/inline/dyn_trait.rs | 35 ------ .../inline/dyn_trait.try_execute_query.Inline.diff | 33 ----- .../inline/exponential_runtime.main.Inline.diff | 50 -------- src/test/mir-opt/inline/exponential_runtime.rs | 87 ------------- .../inline/inline_any_operand.bar.Inline.after.mir | 36 ------ src/test/mir-opt/inline/inline_any_operand.rs | 18 --- src/test/mir-opt/inline/inline_async.rs | 18 --- .../inline/inline_closure.foo.Inline.after.mir | 49 -------- src/test/mir-opt/inline/inline_closure.rs | 13 -- ...inline_closure_borrows_arg.foo.Inline.after.mir | 52 -------- .../mir-opt/inline/inline_closure_borrows_arg.rs | 17 --- .../inline_closure_captures.foo.Inline.after.mir | 65 ---------- src/test/mir-opt/inline/inline_closure_captures.rs | 13 -- ...e_compatibility.inlined_no_sanitize.Inline.diff | 24 ---- ...ompatibility.inlined_target_feature.Inline.diff | 24 ---- ...ompatibility.not_inlined_c_variadic.Inline.diff | 25 ---- ...mpatibility.not_inlined_no_sanitize.Inline.diff | 22 ---- ...tibility.not_inlined_target_feature.Inline.diff | 22 ---- src/test/mir-opt/inline/inline_compatibility.rs | 55 --------- .../mir-opt/inline/inline_cycle.one.Inline.diff | 27 ---- src/test/mir-opt/inline/inline_cycle.rs | 60 --------- .../mir-opt/inline/inline_cycle.two.Inline.diff | 42 ------- .../inline/inline_cycle_generic.main.Inline.diff | 29 ----- src/test/mir-opt/inline/inline_cycle_generic.rs | 40 ------ .../mir-opt/inline/inline_diverging.f.Inline.diff | 24 ---- .../mir-opt/inline/inline_diverging.g.Inline.diff | 49 -------- .../mir-opt/inline/inline_diverging.h.Inline.diff | 88 ------------- src/test/mir-opt/inline/inline_diverging.rs | 40 ------ .../inline/inline_generator.main.Inline.diff | 136 --------------------- src/test/mir-opt/inline/inline_generator.rs | 16 --- .../inline_instruction_set.default.Inline.diff | 60 --------- src/test/mir-opt/inline/inline_instruction_set.rs | 61 --------- .../inline/inline_instruction_set.t32.Inline.diff | 58 --------- .../inline/inline_into_box_place.main.Inline.diff | 82 ------------- src/test/mir-opt/inline/inline_into_box_place.rs | 9 -- .../inline/inline_options.main.Inline.after.mir | 55 --------- src/test/mir-opt/inline/inline_options.rs | 19 --- .../inline/inline_retag.bar.Inline.after.mir | 68 ----------- src/test/mir-opt/inline/inline_retag.rs | 18 --- .../mir-opt/inline/inline_shims.clone.Inline.diff | 26 ---- .../mir-opt/inline/inline_shims.drop.Inline.diff | 56 --------- src/test/mir-opt/inline/inline_shims.rs | 13 -- .../inline/inline_specialization.main.Inline.diff | 28 ----- src/test/mir-opt/inline/inline_specialization.rs | 15 --- src/test/mir-opt/inline/inline_trait_method.rs | 22 ---- .../inline_trait_method.test.Inline.after.mir | 21 ---- src/test/mir-opt/inline/inline_trait_method_2.rs | 27 ---- .../inline_trait_method_2.test2.Inline.after.mir | 28 ----- ...e_58867_inline_as_ref_as_mut.a.Inline.after.mir | 30 ----- ...e_58867_inline_as_ref_as_mut.b.Inline.after.mir | 38 ------ ...e_58867_inline_as_ref_as_mut.c.Inline.after.mir | 22 ---- ...e_58867_inline_as_ref_as_mut.d.Inline.after.mir | 26 ---- .../inline/issue_58867_inline_as_ref_as_mut.rs | 27 ---- ...7_inline_scopes_parenting.main.Inline.after.mir | 42 ------- .../inline/issue_76997_inline_scopes_parenting.rs | 7 -- .../mir-opt/inline/issue_78442.bar.Inline.diff | 68 ----------- .../mir-opt/inline/issue_78442.bar.RevealAll.diff | 57 --------- src/test/mir-opt/inline/issue_78442.rs | 20 --- src/test/mir-opt/inline/polymorphic_recursion.rs | 25 ---- 69 files changed, 2617 deletions(-) delete mode 100644 src/test/mir-opt/inline/asm_unwind.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/asm_unwind.rs delete mode 100644 src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff delete mode 100644 src/test/mir-opt/inline/caller_with_trivial_bound.rs delete mode 100644 src/test/mir-opt/inline/cycle.f.Inline.diff delete mode 100644 src/test/mir-opt/inline/cycle.g.Inline.diff delete mode 100644 src/test/mir-opt/inline/cycle.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/cycle.rs delete mode 100644 src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff delete mode 100644 src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff delete mode 100644 src/test/mir-opt/inline/dyn_trait.rs delete mode 100644 src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff delete mode 100644 src/test/mir-opt/inline/exponential_runtime.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/exponential_runtime.rs delete mode 100644 src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_any_operand.rs delete mode 100644 src/test/mir-opt/inline/inline_async.rs delete mode 100644 src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_closure.rs delete mode 100644 src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_closure_borrows_arg.rs delete mode 100644 src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_closure_captures.rs delete mode 100644 src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_compatibility.rs delete mode 100644 src/test/mir-opt/inline/inline_cycle.one.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_cycle.rs delete mode 100644 src/test/mir-opt/inline/inline_cycle.two.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_cycle_generic.rs delete mode 100644 src/test/mir-opt/inline/inline_diverging.f.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_diverging.g.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_diverging.h.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_diverging.rs delete mode 100644 src/test/mir-opt/inline/inline_generator.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_generator.rs delete mode 100644 src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_instruction_set.rs delete mode 100644 src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_into_box_place.rs delete mode 100644 src/test/mir-opt/inline/inline_options.main.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_options.rs delete mode 100644 src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_retag.rs delete mode 100644 src/test/mir-opt/inline/inline_shims.clone.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_shims.drop.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_shims.rs delete mode 100644 src/test/mir-opt/inline/inline_specialization.main.Inline.diff delete mode 100644 src/test/mir-opt/inline/inline_specialization.rs delete mode 100644 src/test/mir-opt/inline/inline_trait_method.rs delete mode 100644 src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/inline_trait_method_2.rs delete mode 100644 src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs delete mode 100644 src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir delete mode 100644 src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs delete mode 100644 src/test/mir-opt/inline/issue_78442.bar.Inline.diff delete mode 100644 src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff delete mode 100644 src/test/mir-opt/inline/issue_78442.rs delete mode 100644 src/test/mir-opt/inline/polymorphic_recursion.rs (limited to 'src/test/mir-opt/inline') diff --git a/src/test/mir-opt/inline/asm_unwind.main.Inline.diff b/src/test/mir-opt/inline/asm_unwind.main.Inline.diff deleted file mode 100644 index f1b62ac38..000000000 --- a/src/test/mir-opt/inline/asm_unwind.main.Inline.diff +++ /dev/null @@ -1,45 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/asm_unwind.rs:+0:15: +0:15 - let _1: (); // in scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10 -+ scope 1 (inlined foo) { // at $DIR/asm_unwind.rs:21:5: 21:10 -+ let _2: D; // in scope 1 at $DIR/asm_unwind.rs:15:9: 15:11 -+ scope 2 { -+ debug _d => _2; // in scope 2 at $DIR/asm_unwind.rs:15:9: 15:11 -+ scope 3 { -+ } -+ } -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10 -- _1 = foo() -> bb1; // scope 0 at $DIR/asm_unwind.rs:+1:5: +1:10 -- // mir::Constant -- // + span: $DIR/asm_unwind.rs:21:5: 21:8 -- // + literal: Const { ty: fn() {foo}, val: Value() } -+ StorageLive(_2); // scope 1 at $DIR/asm_unwind.rs:15:9: 15:11 -+ asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind: bb3]; // scope 3 at $DIR/asm_unwind.rs:16:14: 16:54 - } - - bb1: { -+ drop(_2) -> bb2; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2 -+ } -+ -+ bb2: { -+ StorageDead(_2); // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2 - StorageDead(_1); // scope 0 at $DIR/asm_unwind.rs:+1:10: +1:11 - _0 = const (); // scope 0 at $DIR/asm_unwind.rs:+0:15: +2:2 - return; // scope 0 at $DIR/asm_unwind.rs:+2:2: +2:2 -+ } -+ -+ bb3 (cleanup): { -+ drop(_2) -> bb4; // scope 1 at $DIR/asm_unwind.rs:17:1: 17:2 -+ } -+ -+ bb4 (cleanup): { -+ resume; // scope 1 at $DIR/asm_unwind.rs:14:1: 17:2 - } - } - diff --git a/src/test/mir-opt/inline/asm_unwind.rs b/src/test/mir-opt/inline/asm_unwind.rs deleted file mode 100644 index c03feb433..000000000 --- a/src/test/mir-opt/inline/asm_unwind.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Tests inlining of `may_unwind` inline assembly. -// -// ignore-wasm32-bare compiled with panic=abort by default -// needs-asm-support -#![feature(asm_unwind)] - -struct D; - -impl Drop for D { - fn drop(&mut self) {} -} - -#[inline(always)] -fn foo() { - let _d = D; - unsafe { std::arch::asm!("", options(may_unwind)) }; -} - -// EMIT_MIR asm_unwind.main.Inline.diff -pub fn main() { - foo(); -} 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 deleted file mode 100644 index 8b0300678..000000000 --- a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff +++ /dev/null @@ -1,33 +0,0 @@ -- // MIR for `foo` before Inline -+ // MIR for `foo` after Inline - - fn foo() -> () { - let mut _0: (); // return place in scope 0 at $DIR/caller_with_trivial_bound.rs:+1:1: +1:1 - let mut _1: >::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:+4:9: +4:14 - } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/caller_with_trivial_bound.rs:+4:9: +4:14 - _1 = bar::() -> 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() -> >::Item {bar::}, val: Value() } - } - - bb1: { - _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:+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:+0:1: +5:2 - } - } - diff --git a/src/test/mir-opt/inline/caller_with_trivial_bound.rs b/src/test/mir-opt/inline/caller_with_trivial_bound.rs deleted file mode 100644 index 8545db894..000000000 --- a/src/test/mir-opt/inline/caller_with_trivial_bound.rs +++ /dev/null @@ -1,26 +0,0 @@ -// ignore-wasm32 compiled with panic=abort by default -// needs-unwind - -#![crate_type = "lib"] -pub trait Factory { - type Item; -} - -pub struct IntFactory; - -impl Factory for IntFactory { - type Item = usize; -} - -// EMIT_MIR caller_with_trivial_bound.foo.Inline.diff -pub fn foo() -where - IntFactory: Factory, -{ - let mut x: >::Item = bar::(); -} - -#[inline(always)] -pub fn bar() -> >::Item { - 0usize -} diff --git a/src/test/mir-opt/inline/cycle.f.Inline.diff b/src/test/mir-opt/inline/cycle.f.Inline.diff deleted file mode 100644 index 75ea69a42..000000000 --- a/src/test/mir-opt/inline/cycle.f.Inline.diff +++ /dev/null @@ -1,43 +0,0 @@ -- // MIR for `f` before Inline -+ // MIR for `f` after Inline - - fn f(_1: impl Fn()) -> () { - 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:+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 = >::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<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> >::Output {>::call}, val: Value() } - } - - bb1: { - 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:+2:2: +2:2 - } - - bb3 (cleanup): { - drop(_1) -> bb4; // scope 0 at $DIR/cycle.rs:+2:1: +2:2 - } - - bb4 (cleanup): { - 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 deleted file mode 100644 index afe157ccd..000000000 --- a/src/test/mir-opt/inline/cycle.g.Inline.diff +++ /dev/null @@ -1,58 +0,0 @@ -- // MIR for `g` before Inline -+ // MIR for `g` after Inline - - fn g() -> () { - 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::) { // 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 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:12 -- _1 = f::(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::}, val: Value() } -- // mir::Constant - // + span: $DIR/cycle.rs:12:7: 12:11 - // + literal: Const { ty: fn() {main}, val: Value() } -+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 -+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 -+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ _3 = >::call(move _4, move _5) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ // mir::Constant -+ // + span: $DIR/cycle.rs:6:5: 6:6 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {main}, ()) -> >::Output {>::call}, val: Value() } - } - - bb1: { -+ 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: { -+ 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 -+ } -+ -+ bb3 (cleanup): { -+ drop(_2) -> bb4; // scope 1 at $DIR/cycle.rs:7:1: 7:2 -+ } -+ -+ bb4 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 - } - } - diff --git a/src/test/mir-opt/inline/cycle.main.Inline.diff b/src/test/mir-opt/inline/cycle.main.Inline.diff deleted file mode 100644 index bd89e09ec..000000000 --- a/src/test/mir-opt/inline/cycle.main.Inline.diff +++ /dev/null @@ -1,58 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - 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::) { // 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 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/cycle.rs:+1:5: +1:9 -- _1 = f::(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::}, val: Value() } -- // mir::Constant - // + span: $DIR/cycle.rs:17:7: 17:8 - // + literal: Const { ty: fn() {g}, val: Value() } -+ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:6:5: 6:6 -+ _4 = &_2; // scope 1 at $DIR/cycle.rs:6:5: 6:6 -+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ _3 = >::call(move _4, move _5) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/cycle.rs:6:5: 6:8 -+ // mir::Constant -+ // + span: $DIR/cycle.rs:6:5: 6:6 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {g}, ()) -> >::Output {>::call}, val: Value() } - } - - bb1: { -+ 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: { -+ 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 -+ } -+ -+ bb3 (cleanup): { -+ drop(_2) -> bb4; // scope 1 at $DIR/cycle.rs:7:1: 7:2 -+ } -+ -+ bb4 (cleanup): { -+ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2 - } - } - diff --git a/src/test/mir-opt/inline/cycle.rs b/src/test/mir-opt/inline/cycle.rs deleted file mode 100644 index 9e8950d8a..000000000 --- a/src/test/mir-opt/inline/cycle.rs +++ /dev/null @@ -1,18 +0,0 @@ -// ignore-wasm32-bare compiled with panic=abort by default - -// EMIT_MIR cycle.f.Inline.diff -#[inline(always)] -fn f(g: impl Fn()) { - g(); -} - -// EMIT_MIR cycle.g.Inline.diff -#[inline(always)] -fn g() { - f(main); -} - -// EMIT_MIR cycle.main.Inline.diff -fn main() { - f(g); -} 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 deleted file mode 100644 index 8ea1a0757..000000000 --- a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff +++ /dev/null @@ -1,54 +0,0 @@ -- // MIR for `get_query` before Inline -+ // MIR for `get_query` after Inline - - fn get_query(_1: &T) -> () { - 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: &::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: &::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:+1:9: +1:10 -+ scope 2 (inlined try_execute_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>; // in scope 2 at $DIR/dyn_trait.rs:27:14: 27:15 -+ scope 3 (inlined mk_cycle::<::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 -+ } -+ } - } - - bb0: { - 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 = ::cache::(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) - // + literal: Const { ty: for<'a> fn(&'a T) -> &'a ::C {::cache::}, val: Value() } - } - - bb1: { - 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::<::C>(move _4) -> bb2; // scope 1 at $DIR/dyn_trait.rs:+2:5: +2:25 -+ StorageLive(_5); // scope 2 at $DIR/dyn_trait.rs:27:14: 27:15 -+ _5 = move _4 as &dyn Cache::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn_trait.rs:27:14: 27:15 -+ _0 = ::V> as Cache>::store_nocache(move _5) -> bb2; // scope 3 at $DIR/dyn_trait.rs:21:5: 21:22 - // mir::Constant -- // + span: $DIR/dyn_trait.rs:34:5: 34:22 -- // + literal: Const { ty: for<'a> fn(&'a ::C) {try_execute_query::<::C>}, val: Value() } -+ // + span: $DIR/dyn_trait.rs:21:7: 21:20 -+ // + literal: Const { ty: for<'a> fn(&'a dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } - } - - bb2: { -+ StorageDead(_5); // scope 2 at $DIR/dyn_trait.rs:27:15: 27:16 - StorageDead(_4); // scope 1 at $DIR/dyn_trait.rs:+2:24: +2:25 - StorageDead(_2); // scope 0 at $DIR/dyn_trait.rs:+3:1: +3:2 - return; // scope 0 at $DIR/dyn_trait.rs:+3:2: +3:2 - } - } - diff --git a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff deleted file mode 100644 index 7653a5ded..000000000 --- a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff +++ /dev/null @@ -1,23 +0,0 @@ -- // MIR for `mk_cycle` before Inline -+ // MIR for `mk_cycle` after Inline - - fn mk_cycle(_1: &dyn Cache) -> () { - 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; // in scope 0 at $DIR/dyn_trait.rs:+1:5: +1:22 - - bb0: { - 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 = 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<'a> fn(&'a dyn Cache) { as Cache>::store_nocache}, val: Value() } - } - - bb1: { - 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.rs b/src/test/mir-opt/inline/dyn_trait.rs deleted file mode 100644 index 6a46e1e07..000000000 --- a/src/test/mir-opt/inline/dyn_trait.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![crate_type = "lib"] - -use std::fmt::Debug; - -pub trait Cache { - type V: Debug; - - fn store_nocache(&self); -} - -pub trait Query { - type V; - type C: Cache; - - fn cache(s: &T) -> &Self::C; -} - -// EMIT_MIR dyn_trait.mk_cycle.Inline.diff -#[inline(always)] -pub fn mk_cycle(c: &dyn Cache) { - c.store_nocache() -} - -// EMIT_MIR dyn_trait.try_execute_query.Inline.diff -#[inline(always)] -pub fn try_execute_query(c: &C) { - mk_cycle(c) -} - -// EMIT_MIR dyn_trait.get_query.Inline.diff -#[inline(always)] -pub fn get_query(t: &T) { - let c = Q::cache(t); - try_execute_query(c) -} 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 deleted file mode 100644 index a71d73b74..000000000 --- a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff +++ /dev/null @@ -1,33 +0,0 @@ -- // MIR for `try_execute_query` before Inline -+ // MIR for `try_execute_query` after Inline - - fn try_execute_query(_1: &C) -> () { - 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>; // 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::<::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 -+ } - - bb0: { - 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> (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::<::V>(move _2) -> bb1; // scope 0 at $DIR/dyn_trait.rs:+1:5: +1:16 -+ _0 = ::V> as Cache>::store_nocache(move _2) -> bb1; // scope 1 at $DIR/dyn_trait.rs:21:5: 21:22 - // mir::Constant -- // + span: $DIR/dyn_trait.rs:27:5: 27:13 -- // + literal: Const { ty: for<'a> fn(&'a (dyn Cache::V> + 'a)) {mk_cycle::<::V>}, val: Value() } -+ // + span: $DIR/dyn_trait.rs:21:7: 21:20 -+ // + literal: Const { ty: for<'a> fn(&'a dyn Cache::V>) {::V> as Cache>::store_nocache}, val: Value() } - } - - bb1: { - StorageDead(_2); // scope 0 at $DIR/dyn_trait.rs:+1:15: +1:16 - return; // scope 0 at $DIR/dyn_trait.rs:+2:2: +2:2 - } - } - diff --git a/src/test/mir-opt/inline/exponential_runtime.main.Inline.diff b/src/test/mir-opt/inline/exponential_runtime.main.Inline.diff deleted file mode 100644 index d9fd7b324..000000000 --- a/src/test/mir-opt/inline/exponential_runtime.main.Inline.diff +++ /dev/null @@ -1,50 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/exponential_runtime.rs:+0:11: +0:11 - let _1: (); // in scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 -+ scope 1 (inlined <() as G>::call) { // at $DIR/exponential_runtime.rs:86:5: 86:22 -+ let _2: (); // in scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25 -+ let _3: (); // in scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 -+ let _4: (); // in scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 -- _1 = <() as G>::call() -> bb1; // scope 0 at $DIR/exponential_runtime.rs:+1:5: +1:22 -+ StorageLive(_2); // scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25 -+ _2 = <() as F>::call() -> bb1; // scope 1 at $DIR/exponential_runtime.rs:73:9: 73:25 - // mir::Constant -- // + span: $DIR/exponential_runtime.rs:86:5: 86:20 -- // + literal: Const { ty: fn() {<() as G>::call}, val: Value() } -+ // + span: $DIR/exponential_runtime.rs:73:9: 73:23 -+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value() } - } - - bb1: { -+ StorageDead(_2); // scope 1 at $DIR/exponential_runtime.rs:73:25: 73:26 -+ StorageLive(_3); // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 -+ _3 = <() as F>::call() -> bb2; // scope 1 at $DIR/exponential_runtime.rs:74:9: 74:25 -+ // mir::Constant -+ // + span: $DIR/exponential_runtime.rs:74:9: 74:23 -+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value() } -+ } -+ -+ bb2: { -+ StorageDead(_3); // scope 1 at $DIR/exponential_runtime.rs:74:25: 74:26 -+ StorageLive(_4); // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 -+ _4 = <() as F>::call() -> bb3; // scope 1 at $DIR/exponential_runtime.rs:75:9: 75:25 -+ // mir::Constant -+ // + span: $DIR/exponential_runtime.rs:75:9: 75:23 -+ // + literal: Const { ty: fn() {<() as F>::call}, val: Value() } -+ } -+ -+ bb3: { -+ StorageDead(_4); // scope 1 at $DIR/exponential_runtime.rs:75:25: 75:26 - StorageDead(_1); // scope 0 at $DIR/exponential_runtime.rs:+1:22: +1:23 - _0 = const (); // scope 0 at $DIR/exponential_runtime.rs:+0:11: +2:2 - return; // scope 0 at $DIR/exponential_runtime.rs:+2:2: +2:2 - } - } - diff --git a/src/test/mir-opt/inline/exponential_runtime.rs b/src/test/mir-opt/inline/exponential_runtime.rs deleted file mode 100644 index d9219d76a..000000000 --- a/src/test/mir-opt/inline/exponential_runtime.rs +++ /dev/null @@ -1,87 +0,0 @@ -// Checks that code with exponential runtime does not have exponential behavior in inlining. - -trait A { - fn call(); -} - -trait B { - fn call(); -} -impl B for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -trait C { - fn call(); -} -impl C for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -trait D { - fn call(); -} -impl D for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -trait E { - fn call(); -} -impl E for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -trait F { - fn call(); -} -impl F for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -trait G { - fn call(); -} -impl G for T { - #[inline] - fn call() { - ::call(); - ::call(); - ::call(); - } -} - -impl A for () { - #[inline(never)] - fn call() {} -} - -// EMIT_MIR exponential_runtime.main.Inline.diff -fn main() { - <() as G>::call(); -} 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 deleted file mode 100644 index 3502c2586..000000000 --- a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir +++ /dev/null @@ -1,36 +0,0 @@ -// MIR for `bar` after Inline - -fn bar() -> bool { - 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:+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 - } - } - - bb0: { - 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() } - 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 - _0 = Eq(move _3, move _4); // scope 2 at $DIR/inline_any_operand.rs:17:5: 17:11 - StorageDead(_4); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13 - StorageDead(_3); // scope 1 at $DIR/inline_any_operand.rs:+2:5: +2:13 - StorageDead(_2); // scope 1 at $DIR/inline_any_operand.rs:+2:12: +2:13 - 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 - } -} diff --git a/src/test/mir-opt/inline/inline_any_operand.rs b/src/test/mir-opt/inline/inline_any_operand.rs deleted file mode 100644 index fb0de020f..000000000 --- a/src/test/mir-opt/inline/inline_any_operand.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags: -Z span_free_formats - -// Tests that MIR inliner works for any operand - -fn main() { - println!("{}", bar()); -} - -// EMIT_MIR inline_any_operand.bar.Inline.after.mir -fn bar() -> bool { - let f = foo; - f(1, -1) -} - -#[inline(always)] -fn foo(x: i32, y: i32) -> bool { - x == y -} diff --git a/src/test/mir-opt/inline/inline_async.rs b/src/test/mir-opt/inline/inline_async.rs deleted file mode 100644 index 5c838159b..000000000 --- a/src/test/mir-opt/inline/inline_async.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Checks that inliner doesn't introduce cycles when optimizing generators. -// The outcome of optimization is not verfied, just the absence of the cycle. -// Regression test for #76181. -// -// edition:2018 - -#![crate_type = "lib"] - -pub struct S; - -impl S { - pub async fn g(&mut self) { - self.h(); - } - pub fn h(&mut self) { - let _ = self.g(); - } -} 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 deleted file mode 100644 index 9eb3a01ee..000000000 --- a/src/test/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ /dev/null @@ -1,49 +0,0 @@ -// MIR for `foo` after Inline - -fn foo(_1: T, _2: i32) -> i32 { - 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::{closure#0}]; // in scope 0 at $DIR/inline_closure.rs:+1:9: +1:10 - let mut _4: &[closure@foo::{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:+1:9: +1:10 - scope 2 (inlined foo::::{closure#0}) { // at $DIR/inline_closure.rs:12:5: 12:12 - 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:+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 - } -} diff --git a/src/test/mir-opt/inline/inline_closure.rs b/src/test/mir-opt/inline/inline_closure.rs deleted file mode 100644 index 715fd0138..000000000 --- a/src/test/mir-opt/inline/inline_closure.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags: -Z span_free_formats - -// Tests that MIR inliner can handle closure arguments. (#45894) - -fn main() { - println!("{}", foo(0, 14)); -} - -// EMIT_MIR inline_closure.foo.Inline.after.mir -fn foo(_t: T, q: i32) -> i32 { - let x = |_t, _q| _t; - x(q, q) -} 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 deleted file mode 100644 index dd32eb2d8..000000000 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ /dev/null @@ -1,52 +0,0 @@ -// 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:+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::{closure#0}]; // in scope 0 at $DIR/inline_closure_borrows_arg.rs:+1:9: +1:10 - let mut _4: &[closure@foo::{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:+1:9: +1:10 - scope 2 (inlined foo::::{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:+1:14: +1:15 - debug _s => _9; // in scope 2 at $DIR/inline_closure_borrows_arg.rs:+1:23: +1:25 - scope 3 { - debug variable => _8; // 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:+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 - _0 = (*_8); // scope 3 at $DIR/inline_closure_borrows_arg.rs:+3:9: +3:18 - 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 - } -} diff --git a/src/test/mir-opt/inline/inline_closure_borrows_arg.rs b/src/test/mir-opt/inline/inline_closure_borrows_arg.rs deleted file mode 100644 index d76bc33f5..000000000 --- a/src/test/mir-opt/inline/inline_closure_borrows_arg.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags: -Z span_free_formats -Zunsound-mir-opts - -// Tests that MIR inliner can handle closure arguments, -// even when (#45894) - -fn main() { - println!("{}", foo(0, &14)); -} - -// EMIT_MIR inline_closure_borrows_arg.foo.Inline.after.mir -fn foo(_t: T, q: &i32) -> i32 { - let x = |r: &i32, _s: &i32| { - let variable = &*r; - *variable - }; - x(q, q) -} 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 deleted file mode 100644 index fd19c2886..000000000 --- a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ /dev/null @@ -1,65 +0,0 @@ -// 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:+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::{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::{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:+1:9: +1:10 - scope 2 (inlined foo::::{closure#0}) { // at $DIR/inline_closure_captures.rs:12:5: 12:9 - 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:24 - let mut _13: &T; // in scope 2 at $DIR/inline_closure_captures.rs:+1:13: +1:24 - } - } - - bb0: { - 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 - _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 - StorageLive(_11); // 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 - 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 - } -} diff --git a/src/test/mir-opt/inline/inline_closure_captures.rs b/src/test/mir-opt/inline/inline_closure_captures.rs deleted file mode 100644 index 52b6817e4..000000000 --- a/src/test/mir-opt/inline/inline_closure_captures.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags: -Z span_free_formats - -// Tests that MIR inliner can handle closure captures. - -fn main() { - println!("{:?}", foo(0, 14)); -} - -// EMIT_MIR inline_closure_captures.foo.Inline.after.mir -fn foo(t: T, q: i32) -> (i32, T) { - let x = |_q| (q, t); - x(q) -} 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 deleted file mode 100644 index e30a5e116..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.diff +++ /dev/null @@ -1,24 +0,0 @@ -- // MIR for `inlined_no_sanitize` before Inline -+ // MIR for `inlined_no_sanitize` after Inline - - fn inlined_no_sanitize() -> () { - 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:+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() } -- } -- -- bb1: { - 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 - } - } - 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 deleted file mode 100644 index c2b3c46a3..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.diff +++ /dev/null @@ -1,24 +0,0 @@ -- // MIR for `inlined_target_feature` before Inline -+ // MIR for `inlined_target_feature` after Inline - - fn inlined_target_feature() -> () { - 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:+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() } -- } -- -- bb1: { - 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 - } - } - 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 deleted file mode 100644 index 0ca5a5f70..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.diff +++ /dev/null @@ -1,25 +0,0 @@ -- // MIR for `not_inlined_c_variadic` before Inline -+ // 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:+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:+1:9: +1:10 - } - - bb0: { - 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() } - } - - bb1: { - _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 deleted file mode 100644 index 00d405c77..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.diff +++ /dev/null @@ -1,22 +0,0 @@ -- // MIR for `not_inlined_no_sanitize` before Inline -+ // 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:+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:+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() } - } - - bb1: { - 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 deleted file mode 100644 index 8b9c86f55..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.diff +++ /dev/null @@ -1,22 +0,0 @@ -- // MIR for `not_inlined_target_feature` before Inline -+ // 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:+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:+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() } - } - - bb1: { - 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_compatibility.rs b/src/test/mir-opt/inline/inline_compatibility.rs deleted file mode 100644 index 30aff0a64..000000000 --- a/src/test/mir-opt/inline/inline_compatibility.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Checks that only functions with compatible attributes are inlined. -// -// only-x86_64 - -#![crate_type = "lib"] -#![feature(no_sanitize)] -#![feature(target_feature_11)] -#![feature(c_variadic)] - -// EMIT_MIR inline_compatibility.inlined_target_feature.Inline.diff -#[target_feature(enable = "sse2")] -pub unsafe fn inlined_target_feature() { - target_feature(); -} - -// EMIT_MIR inline_compatibility.not_inlined_target_feature.Inline.diff -pub unsafe fn not_inlined_target_feature() { - target_feature(); -} - -// EMIT_MIR inline_compatibility.inlined_no_sanitize.Inline.diff -#[no_sanitize(address)] -pub unsafe fn inlined_no_sanitize() { - no_sanitize(); -} - -// EMIT_MIR inline_compatibility.not_inlined_no_sanitize.Inline.diff -pub unsafe fn not_inlined_no_sanitize() { - no_sanitize(); -} - -#[inline] -#[target_feature(enable = "sse2")] -pub unsafe fn target_feature() {} - -#[inline] -#[no_sanitize(address)] -pub unsafe fn no_sanitize() {} - -// EMIT_MIR inline_compatibility.not_inlined_c_variadic.Inline.diff -pub unsafe fn not_inlined_c_variadic() { - let s = sum(4u32, 4u32, 30u32, 200u32, 1000u32); -} - -#[no_mangle] -#[inline(always)] -unsafe extern "C" fn sum(n: u32, mut vs: ...) -> u32 { - let mut s = 0; - let mut i = 0; - while i != n { - s += vs.arg::(); - i += 1; - } - s -} diff --git a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff deleted file mode 100644 index f54a1a747..000000000 --- a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff +++ /dev/null @@ -1,27 +0,0 @@ -- // MIR for `one` before Inline -+ // MIR for `one` after Inline - - fn one() -> () { - 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 ::call) { // at $DIR/inline_cycle.rs:14:5: 14:24 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24 -- _1 = ::call() -> bb1; // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:24 -+ _1 = as Call>::call() -> bb1; // scope 1 at $DIR/inline_cycle.rs:43:9: 43:23 - // mir::Constant -- // + span: $DIR/inline_cycle.rs:14:5: 14:22 -- // + literal: Const { ty: fn() {::call}, val: Value() } -+ // + span: $DIR/inline_cycle.rs:43:9: 43:21 -+ // + literal: Const { ty: fn() { as Call>::call}, val: Value() } - } - - bb1: { - 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 - } - } - diff --git a/src/test/mir-opt/inline/inline_cycle.rs b/src/test/mir-opt/inline/inline_cycle.rs deleted file mode 100644 index 63ad57de1..000000000 --- a/src/test/mir-opt/inline/inline_cycle.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Check that inliner handles various forms of recursion and doesn't fall into -// an infinite inlining cycle. The particular outcome of inlining is not -// crucial otherwise. -// -// Regression test for issue #78573. - -fn main() { - one(); - two(); -} - -// EMIT_MIR inline_cycle.one.Inline.diff -fn one() { - ::call(); -} - -pub trait Call { - fn call(); -} - -pub struct A(T); -pub struct B(T); -pub struct C; - -impl Call for A { - #[inline] - fn call() { - as Call>::call() - } -} - - -impl Call for B { - #[inline] - fn call() { - ::call() - } -} - -impl Call for C { - #[inline] - fn call() { - A::::call() - } -} - -// EMIT_MIR inline_cycle.two.Inline.diff -fn two() { - call(f); -} - -#[inline] -fn call(f: F) { - f(); -} - -#[inline] -fn f() { - call(f); -} diff --git a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff deleted file mode 100644 index a940848c2..000000000 --- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff +++ /dev/null @@ -1,42 +0,0 @@ -- // MIR for `two` before Inline -+ // MIR for `two` after Inline - - fn two() -> () { - 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::) { // 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: (); // in scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12 -- _1 = call::(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 -- // + literal: Const { ty: fn(fn() {f}) {call::}, val: Value() } -- // mir::Constant - // + span: $DIR/inline_cycle.rs:49:10: 49:11 - // + literal: Const { ty: fn() {f}, val: Value() } -+ 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:8 -+ _3 = >::call_once(move _2, move _4) -> bb1; // scope 1 at $DIR/inline_cycle.rs:54:5: 54:8 -+ // mir::Constant -+ // + span: $DIR/inline_cycle.rs:54:5: 54:6 -+ // + literal: Const { ty: extern "rust-call" fn(fn() {f}, ()) -> >::Output {>::call_once}, val: Value() } - } - - bb1: { -+ StorageDead(_4); // scope 1 at $DIR/inline_cycle.rs:54:7: 54:8 -+ StorageDead(_3); // scope 1 at $DIR/inline_cycle.rs:54:8: 54:9 -+ StorageDead(_2); // scope 0 at $DIR/inline_cycle.rs:+1:5: +1:12 - StorageDead(_1); // scope 0 at $DIR/inline_cycle.rs:+1:12: +1:13 - _0 = const (); // scope 0 at $DIR/inline_cycle.rs:+0:10: +2:2 - return; // scope 0 at $DIR/inline_cycle.rs:+2:2: +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 deleted file mode 100644 index 04de3e61e..000000000 --- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff +++ /dev/null @@ -1,29 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline_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 ::call) { // at $DIR/inline_cycle_generic.rs:9:5: 9:24 -+ scope 2 (inlined as Call>::call) { // at $DIR/inline_cycle_generic.rs:38:9: 38:31 -+ } -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 -- _1 = ::call() -> bb1; // scope 0 at $DIR/inline_cycle_generic.rs:+1:5: +1:24 -+ _1 = ::call() -> bb1; // scope 2 at $DIR/inline_cycle_generic.rs:31:9: 31:28 - // mir::Constant -- // + span: $DIR/inline_cycle_generic.rs:9:5: 9:22 -- // + literal: Const { ty: fn() {::call}, val: Value() } -+ // + span: $DIR/inline_cycle_generic.rs:31:9: 31:26 -+ // + literal: Const { ty: fn() {::call}, val: Value() } - } - - bb1: { - 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 - } - } - diff --git a/src/test/mir-opt/inline/inline_cycle_generic.rs b/src/test/mir-opt/inline/inline_cycle_generic.rs deleted file mode 100644 index 24b4f3793..000000000 --- a/src/test/mir-opt/inline/inline_cycle_generic.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Check that inliner handles various forms of recursion and doesn't fall into -// an infinite inlining cycle. The particular outcome of inlining is not -// crucial otherwise. -// -// Regression test for issue #78573. - -// EMIT_MIR inline_cycle_generic.main.Inline.diff -fn main() { - ::call(); -} - -pub trait Call { - fn call(); -} - -pub struct A; -pub struct B(T); -pub struct C; - -impl Call for A { - #[inline] - fn call() { - as Call>::call() - } -} - - -impl Call for B { - #[inline] - fn call() { - ::call() - } -} - -impl Call for C { - #[inline] - fn call() { - as Call>::call() - } -} diff --git a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff deleted file mode 100644 index b49191f49..000000000 --- a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff +++ /dev/null @@ -1,24 +0,0 @@ -- // MIR for `f` before Inline -+ // MIR for `f` after Inline - - fn f() -> () { - 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:+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() } -+ 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 - } - } - diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff deleted file mode 100644 index 1e703a8fd..000000000 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ /dev/null @@ -1,49 +0,0 @@ -- // MIR for `g` before Inline -+ // MIR for `g` after Inline - - fn g(_1: i32) -> u32 { - 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:+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:+2:9: +2:10 - _4 = _1; // scope 0 at $DIR/inline_diverging.rs:+2:9: +2:10 - _0 = move _4 as u32 (IntToInt); // 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:+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 -- // + span: $DIR/inline_diverging.rs:16:9: 16:14 -- // + literal: Const { ty: fn() -> ! {panic}, val: Value() } -+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL -+ // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value() } -+ // mir::Constant -+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL -+ // + literal: Const { ty: &str, val: Value(Slice(..)) } - } - } - diff --git a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff deleted file mode 100644 index a01bcf164..000000000 --- a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff +++ /dev/null @@ -1,88 +0,0 @@ -- // MIR for `h` before Inline -+ // MIR for `h` after Inline - - fn h() -> () { - 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:: ! {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 _6: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline_diverging.rs:28:13: 28:14 -+ let mut _7: (); // in scope 1 at $DIR/inline_diverging.rs:28:13: 28:16 -+ let mut _8: !; // in scope 1 at $DIR/inline_diverging.rs:29:6: 29:7 -+ let mut _9: !; // in scope 1 at $DIR/inline_diverging.rs:29:9: 29:10 -+ scope 2 { -+ debug a => _3; // in scope 2 at $DIR/inline_diverging.rs:27:9: 27:10 -+ scope 3 { -+ debug b => _9; // in scope 3 at $DIR/inline_diverging.rs:28:9: 28:10 -+ } -+ } -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22 -- _1 = call_twice:: ! {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:: ! {sleep}>}, val: Value() } -- // mir::Constant - // + span: $DIR/inline_diverging.rs:22:16: 22:21 - // + literal: Const { ty: fn() -> ! {sleep}, val: Value() } -+ StorageLive(_9); // scope 0 at $DIR/inline_diverging.rs:+1:5: +1:22 -+ 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 -+ _3 = ! {sleep} as Fn<()>>::call(move _4, move _5) -> [return: bb1, unwind: bb5]; // scope 1 at $DIR/inline_diverging.rs:27:13: 27:16 -+ // mir::Constant -+ // + span: $DIR/inline_diverging.rs:27:13: 27:14 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> ! {sleep} as FnOnce<()>>::Output { ! {sleep} as Fn<()>>::call}, val: Value() } -+ } -+ -+ bb1: { -+ StorageDead(_5); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 -+ StorageDead(_4); // scope 1 at $DIR/inline_diverging.rs:27:15: 27:16 -+ StorageLive(_6); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 -+ _6 = &_2; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:14 -+ StorageLive(_7); // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 -+ _9 = ! {sleep} as Fn<()>>::call(move _6, move _7) -> [return: bb2, unwind: bb4]; // scope 2 at $DIR/inline_diverging.rs:28:13: 28:16 -+ // mir::Constant -+ // + span: $DIR/inline_diverging.rs:28:13: 28:14 -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() -> ! {sleep}, ()) -> ! {sleep} as FnOnce<()>>::Output { ! {sleep} as Fn<()>>::call}, val: Value() } -+ } -+ -+ bb2: { -+ StorageDead(_7); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16 -+ StorageDead(_6); // scope 2 at $DIR/inline_diverging.rs:28:15: 28:16 -+ StorageLive(_8); // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7 -+ _8 = move _3; // scope 3 at $DIR/inline_diverging.rs:29:6: 29:7 -+ Deinit(_1); // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11 -+ (_1.0: !) = move _8; // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11 -+ (_1.1: !) = move _9; // scope 3 at $DIR/inline_diverging.rs:29:5: 29:11 -+ StorageDead(_8); // scope 3 at $DIR/inline_diverging.rs:29:10: 29:11 -+ StorageDead(_3); // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 -+ drop(_2) -> bb3; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 -+ } -+ -+ bb3: { -+ unreachable; // scope 0 at $DIR/inline_diverging.rs:30:2: 30:2 -+ } -+ -+ bb4 (cleanup): { -+ drop(_3) -> bb5; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 -+ } -+ -+ bb5 (cleanup): { -+ drop(_2) -> bb6; // scope 1 at $DIR/inline_diverging.rs:30:1: 30:2 -+ } -+ -+ bb6 (cleanup): { -+ resume; // scope 1 at $DIR/inline_diverging.rs:26:1: 30:2 - } - } - diff --git a/src/test/mir-opt/inline/inline_diverging.rs b/src/test/mir-opt/inline/inline_diverging.rs deleted file mode 100644 index ae6f814c2..000000000 --- a/src/test/mir-opt/inline/inline_diverging.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Tests inlining of diverging calls. -// -// ignore-wasm32-bare compiled with panic=abort by default -#![crate_type = "lib"] - -// EMIT_MIR inline_diverging.f.Inline.diff -pub fn f() { - sleep(); -} - -// EMIT_MIR inline_diverging.g.Inline.diff -pub fn g(i: i32) -> u32 { - if i > 0 { - i as u32 - } else { - panic(); - } -} - -// EMIT_MIR inline_diverging.h.Inline.diff -pub fn h() { - call_twice(sleep); -} - -#[inline(always)] -pub fn call_twice R>(f: F) -> (R, R) { - let a = f(); - let b = f(); - (a, b) -} - -#[inline(always)] -fn panic() -> ! { - panic!(); -} - -#[inline(always)] -fn sleep() -> ! { - loop {} -} diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff deleted file mode 100644 index 91bff3d32..000000000 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ /dev/null @@ -1,136 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline_generator.rs:+0:11: +0:11 - let _1: std::ops::GeneratorState; // 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:+1:9: +1:11 - } -+ scope 2 (inlined g) { // at $DIR/inline_generator.rs:9:28: 9:31 -+ } -+ scope 3 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new) { // at $DIR/inline_generator.rs:9:14: 9:32 -+ debug pointer => _3; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL -+ let mut _5: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL -+ scope 4 { -+ scope 5 (inlined Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new_unchecked) { // at $SRC_DIR/core/src/pin.rs:LL:COL -+ debug pointer => _5; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL -+ let mut _6: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL -+ } -+ } -+ } -+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline_generator.rs:9:14: 9:46 -+ debug a => _7; // 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: u32; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ let mut _10: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ let mut _11: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ let mut _12: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ } - - bb0: { - 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 {g}, val: Value() } -- } -- -- 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:+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) -- // + literal: Const { ty: fn(&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]) -> Pin<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]> {Pin::<&mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>::new}, val: Value() } -- } -- -- bb2: { -+ StorageLive(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL -+ _5 = move _3; // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL -+ StorageLive(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL -+ _6 = move _5; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL -+ Deinit(_2); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL -+ (_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:+1:31: +1:32 -- _1 = <[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator>::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<'a> fn(Pin<&'a mut [generator@$DIR/inline_generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator>::Yield, <[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator>::Return> {<[generator@$DIR/inline_generator.rs:15:5: 15:8] as Generator>::resume}, val: Value() } -+ 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 -+ _10 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ _9 = discriminant((*_10)); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ switchInt(move _9) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 - } - -- bb3: { -+ bb1: { -+ StorageDead(_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:+0:1: +2:2 -+ } -+ -+ bb3: { -+ StorageLive(_8); // scope 6 at $DIR/inline_generator.rs:15:17: 15:39 -+ switchInt(move _7) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline_generator.rs:15:20: 15:21 -+ } -+ -+ bb4: { -+ _8 = const 7_i32; // scope 6 at $DIR/inline_generator.rs:15:24: 15:25 -+ goto -> bb6; // scope 6 at $DIR/inline_generator.rs:15:17: 15:39 -+ } -+ -+ bb5: { -+ _8 = const 13_i32; // scope 6 at $DIR/inline_generator.rs:15:35: 15:37 -+ goto -> bb6; // scope 6 at $DIR/inline_generator.rs:15:17: 15:39 -+ } -+ -+ bb6: { -+ 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 -+ _11 = 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((*_11)) = 3; // scope 6 at $DIR/inline_generator.rs:15:11: 15:39 -+ goto -> bb1; // scope 0 at $DIR/inline_generator.rs:15:11: 15:39 -+ } -+ -+ bb7: { -+ StorageLive(_8); // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ StorageDead(_8); // scope 6 at $DIR/inline_generator.rs:15:38: 15:39 -+ Deinit(_1); // scope 6 at $DIR/inline_generator.rs:15:41: 15:41 -+ ((_1 as Complete).0: bool) = move _7; // scope 6 at $DIR/inline_generator.rs:15:41: 15:41 -+ discriminant(_1) = 1; // scope 6 at $DIR/inline_generator.rs:15:41: 15:41 -+ _12 = deref_copy (_2.0: &mut [generator@$DIR/inline_generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline_generator.rs:15:41: 15:41 -+ discriminant((*_12)) = 1; // scope 6 at $DIR/inline_generator.rs:15:41: 15:41 -+ goto -> bb1; // scope 0 at $DIR/inline_generator.rs:15:41: 15:41 -+ } -+ -+ bb8: { -+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 -+ } -+ -+ bb9: { -+ unreachable; // scope 6 at $DIR/inline_generator.rs:15:5: 15:41 - } - } - diff --git a/src/test/mir-opt/inline/inline_generator.rs b/src/test/mir-opt/inline/inline_generator.rs deleted file mode 100644 index d11b3e548..000000000 --- a/src/test/mir-opt/inline/inline_generator.rs +++ /dev/null @@ -1,16 +0,0 @@ -// ignore-wasm32-bare compiled with panic=abort by default -#![feature(generators, generator_trait)] - -use std::ops::Generator; -use std::pin::Pin; - -// EMIT_MIR inline_generator.main.Inline.diff -fn main() { - let _r = Pin::new(&mut g()).resume(false); -} - -#[inline(always)] -pub fn g() -> impl Generator { - #[inline(always)] - |a| { yield if a { 7 } else { 13 } } -} 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 deleted file mode 100644 index f1988ea4b..000000000 --- a/src/test/mir-opt/inline/inline_instruction_set.default.Inline.diff +++ /dev/null @@ -1,60 +0,0 @@ -- // MIR for `default` before Inline -+ // MIR for `default` after Inline - - fn default() -> () { - 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 - let _4: (); // in scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -+ scope 1 (inlined instruction_set_default) { // at $DIR/inline_instruction_set.rs:59:5: 59:30 -+ } -+ scope 2 (inlined inline_always_and_using_inline_asm) { // at $DIR/inline_instruction_set.rs:60:5: 60:41 -+ scope 3 { -+ } -+ } - - bb0: { - 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:57:5: 57:24 - // + literal: Const { ty: fn() {instruction_set_a32}, val: Value() } - } - - bb1: { - 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:58:5: 58:24 - // + literal: Const { ty: fn() {instruction_set_t32}, val: Value() } - } - - bb2: { - 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:59:5: 59:28 -- // + literal: Const { ty: fn() {instruction_set_default}, val: Value() } -- } -- -- bb3: { - StorageDead(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:30: +3:31 - StorageLive(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -- _4 = inline_always_and_using_inline_asm() -> bb4; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -- // mir::Constant -- // + span: $DIR/inline_instruction_set.rs:60:5: 60:39 -- // + literal: Const { ty: fn() {inline_always_and_using_inline_asm}, val: Value() } -+ asm!("/* do nothing */", options((empty))) -> bb3; // scope 3 at $DIR/inline_instruction_set.rs:43:14: 43:38 - } - -- bb4: { -+ bb3: { - StorageDead(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:41: +4:42 - _0 = const (); // scope 0 at $DIR/inline_instruction_set.rs:+0:18: +5:2 - return; // scope 0 at $DIR/inline_instruction_set.rs:+5:2: +5:2 - } - } - diff --git a/src/test/mir-opt/inline/inline_instruction_set.rs b/src/test/mir-opt/inline/inline_instruction_set.rs deleted file mode 100644 index 5dfb04943..000000000 --- a/src/test/mir-opt/inline/inline_instruction_set.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Checks that only functions with the compatible instruction_set attributes are inlined. -// -// A function is "compatible" when the *callee* has the same attribute or no attribute. -// -// compile-flags: --target thumbv4t-none-eabi -// needs-llvm-components: arm - -#![crate_type = "lib"] -#![feature(rustc_attrs)] -#![feature(no_core, lang_items)] -#![feature(isa_attribute)] -#![no_core] - -#[rustc_builtin_macro] -#[macro_export] -macro_rules! asm { - ("assembly template", - $(operands,)* - $(options($(option),*))? - ) => { - /* compiler built-in */ - }; -} - -#[lang = "sized"] -trait Sized {} -#[lang = "copy"] -trait Copy {} - -#[instruction_set(arm::a32)] -#[inline] -fn instruction_set_a32() {} - -#[instruction_set(arm::t32)] -#[inline] -fn instruction_set_t32() {} - -#[inline] -fn instruction_set_default() {} - -#[inline(always)] -fn inline_always_and_using_inline_asm() { - unsafe { asm!("/* do nothing */") }; -} - -// EMIT_MIR inline_instruction_set.t32.Inline.diff -#[instruction_set(arm::t32)] -pub fn t32() { - instruction_set_a32(); - instruction_set_t32(); - instruction_set_default(); - inline_always_and_using_inline_asm(); -} - -// EMIT_MIR inline_instruction_set.default.Inline.diff -pub fn default() { - instruction_set_a32(); - instruction_set_t32(); - instruction_set_default(); - inline_always_and_using_inline_asm(); -} 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 deleted file mode 100644 index e777b2cc2..000000000 --- a/src/test/mir-opt/inline/inline_instruction_set.t32.Inline.diff +++ /dev/null @@ -1,58 +0,0 @@ -- // MIR for `t32` before Inline -+ // MIR for `t32` after Inline - - fn t32() -> () { - 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:+3:5: +3:30 - let _4: (); // in scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -+ scope 1 (inlined instruction_set_t32) { // at $DIR/inline_instruction_set.rs:50:5: 50:26 -+ } -+ scope 2 (inlined instruction_set_default) { // at $DIR/inline_instruction_set.rs:51:5: 51:30 -+ } - - bb0: { - 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:49:5: 49:24 - // + literal: Const { ty: fn() {instruction_set_a32}, val: Value() } - } - - bb1: { - 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:50:5: 50:24 -- // + literal: Const { ty: fn() {instruction_set_t32}, val: Value() } -- } -- -- bb2: { - 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:51:5: 51:28 -- // + literal: Const { ty: fn() {instruction_set_default}, val: Value() } -- } -- -- bb3: { - StorageDead(_3); // scope 0 at $DIR/inline_instruction_set.rs:+3:30: +3:31 - StorageLive(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -- _4 = inline_always_and_using_inline_asm() -> bb4; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 -+ _4 = inline_always_and_using_inline_asm() -> bb2; // scope 0 at $DIR/inline_instruction_set.rs:+4:5: +4:41 - // mir::Constant - // + span: $DIR/inline_instruction_set.rs:52:5: 52:39 - // + literal: Const { ty: fn() {inline_always_and_using_inline_asm}, val: Value() } - } - -- bb4: { -+ bb2: { - StorageDead(_4); // scope 0 at $DIR/inline_instruction_set.rs:+4:41: +4:42 - _0 = const (); // scope 0 at $DIR/inline_instruction_set.rs:+0:14: +5:2 - return; // scope 0 at $DIR/inline_instruction_set.rs:+5:2: +5:2 - } - } - diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff deleted file mode 100644 index 2a4dc9e3e..000000000 --- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff +++ /dev/null @@ -1,82 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline_into_box_place.rs:+0:11: +0:11 - let _1: std::boxed::Box>; // 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>; // 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; // in scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 -+ let mut _8: &mut std::vec::Vec; // in scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 - scope 1 { - debug _x => _1; // in scope 1 at $DIR/inline_into_box_place.rs:+1:9: +1:11 - } - scope 2 { - } -+ scope 3 (inlined Vec::::new) { // at $DIR/inline_into_box_place.rs:8:33: 8:43 -+ let mut _9: alloc::raw_vec::RawVec; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_into_box_place.rs:+1:9: +1:11 - _2 = SizeOf(std::vec::Vec); // scope 2 at $DIR/inline_into_box_place.rs:+1:29: +1:43 - _3 = AlignOf(std::vec::Vec); // 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() } - } - - bb1: { - StorageLive(_5); // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 - _5 = ShallowInitBox(move _4, std::vec::Vec); // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 - _7 = (((_5.0: std::ptr::Unique>).0: std::ptr::NonNull>).0: *const std::vec::Vec); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 -- (*_7) = Vec::::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 -+ StorageLive(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 -+ _8 = &mut (*_7); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 -+ StorageLive(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ _9 = const _; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL - // mir::Constant -- // + span: $DIR/inline_into_box_place.rs:8:33: 8:41 -- // + user_ty: UserType(1) -- // + literal: Const { ty: fn() -> Vec {Vec::::new}, val: Value() } -- } -- -- bb2: { -+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ // + user_ty: UserType(0) -+ // + literal: Const { ty: alloc::raw_vec::RawVec, val: Unevaluated(alloc::raw_vec::RawVec::::NEW, [u32], None) } -+ Deinit((*_8)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ ((*_8).0: alloc::raw_vec::RawVec) = move _9; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ ((*_8).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ StorageDead(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL -+ StorageDead(_8); // scope 0 at $DIR/inline_into_box_place.rs:+1:33: +1:43 - _1 = move _5; // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:43 - StorageDead(_5); // scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43 - _0 = const (); // scope 0 at $DIR/inline_into_box_place.rs:+0:11: +2:2 -- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2 -+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2 - } - -- bb3: { -+ bb2: { - StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2 - return; // scope 0 at $DIR/inline_into_box_place.rs:+2:2: +2:2 - } - -- bb4 (cleanup): { -+ bb3 (cleanup): { - resume; // scope 0 at $DIR/inline_into_box_place.rs:+0:1: +2:2 -- } -- -- bb5 (cleanup): { -- _6 = alloc::alloc::box_free::, std::alloc::Global>(move (_5.0: std::ptr::Unique>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline_into_box_place.rs:+1:42: +1:43 -- // mir::Constant -- // + span: $DIR/inline_into_box_place.rs:8:42: 8:43 -- // + literal: Const { ty: unsafe fn(Unique>, std::alloc::Global) {alloc::alloc::box_free::, std::alloc::Global>}, val: Value() } - } - } - diff --git a/src/test/mir-opt/inline/inline_into_box_place.rs b/src/test/mir-opt/inline/inline_into_box_place.rs deleted file mode 100644 index 232bcc7b2..000000000 --- a/src/test/mir-opt/inline/inline_into_box_place.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ignore-endian-big -// ignore-wasm32-bare compiled with panic=abort by default -// compile-flags: -Z mir-opt-level=4 - -#![feature(box_syntax)] -// EMIT_MIR inline_into_box_place.main.Inline.diff -fn main() { - let _x: Box> = box Vec::new(); -} 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 deleted file mode 100644 index 1c590be94..000000000 --- a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir +++ /dev/null @@ -1,55 +0,0 @@ -// MIR for `main` after Inline - -fn main() -> () { - 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::) { // 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 - } - - bb0: { - 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() } - } - - bb1: { - StorageDead(_1); // scope 0 at $DIR/inline_options.rs:+1:18: +1:19 - StorageLive(_2); // scope 0 at $DIR/inline_options.rs:+2:5: +2:21 - StorageLive(_3); // scope 1 at $DIR/inline_options.rs:16:23: 16:26 - _3 = g() -> bb2; // scope 1 at $DIR/inline_options.rs:16:23: 16:26 - // mir::Constant - // + span: $DIR/inline_options.rs:16:23: 16:24 - // + literal: Const { ty: fn() {g}, val: Value() } - } - - 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 - // mir::Constant - // + span: $DIR/inline_options.rs:16:28: 16:29 - // + literal: Const { ty: fn() {g}, val: Value() } - } - - 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 - // mir::Constant - // + span: $DIR/inline_options.rs:16:33: 16:34 - // + literal: Const { ty: fn() {g}, val: Value() } - } - - bb4: { - StorageDead(_5); // scope 1 at $DIR/inline_options.rs:16:36: 16:37 - StorageDead(_2); // scope 0 at $DIR/inline_options.rs:+2:21: +2:22 - _0 = const (); // scope 0 at $DIR/inline_options.rs:+0:11: +3:2 - return; // scope 0 at $DIR/inline_options.rs:+3:2: +3:2 - } -} diff --git a/src/test/mir-opt/inline/inline_options.rs b/src/test/mir-opt/inline/inline_options.rs deleted file mode 100644 index 477f050b6..000000000 --- a/src/test/mir-opt/inline/inline_options.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Checks that inlining threshold can be controlled with -// inline-mir-threshold and inline-hint-threshold options. -// -// compile-flags: -Zinline-mir-threshold=90 -// compile-flags: -Zinline-mir-hint-threshold=50 - -// EMIT_MIR inline_options.main.Inline.after.mir -fn main() { - not_inlined(); - inlined::(); -} - -// Cost is approximately 3 * 25 + 5 = 80. -#[inline] -pub fn not_inlined() { g(); g(); g(); } -pub fn inlined() { g(); g(); g(); } - -#[inline(never)] -fn g() {} 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 deleted file mode 100644 index 60149ff36..000000000 --- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ /dev/null @@ -1,68 +0,0 @@ -// MIR for `bar` after Inline - -fn bar() -> bool { - let mut _0: bool; // return place in scope 0 at $DIR/inline_retag.rs:+0:13: +0:17 - let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline_retag.rs:+1:9: +1:10 - let mut _2: for<'a, 'b> fn(&'a i32, &'b 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:+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 - } - } - - bb0: { - 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<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}, val: Value() } - 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 _; // 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:+2:7: +2:9 - _4 = &(*_10); // scope 1 at $DIR/inline_retag.rs:+2:7: +2:9 - _3 = &(*_4); // 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 _; // 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:+2:11: +2:14 - _7 = &(*_9); // 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(_3); // scope 2 at $DIR/inline_retag.rs:16:8: 16:9 - Retag(_6); // scope 2 at $DIR/inline_retag.rs:16:17: 16:18 - StorageLive(_11); // scope 2 at $DIR/inline_retag.rs:17:5: 17:7 - _11 = (*_3); // scope 2 at $DIR/inline_retag.rs:17:5: 17:7 - StorageLive(_12); // scope 2 at $DIR/inline_retag.rs:17:11: 17:13 - _12 = (*_6); // scope 2 at $DIR/inline_retag.rs:17:11: 17:13 - _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline_retag.rs:17:5: 17:13 - StorageDead(_12); // scope 2 at $DIR/inline_retag.rs:17:12: 17:13 - StorageDead(_11); // scope 2 at $DIR/inline_retag.rs:17:12: 17:13 - StorageDead(_6); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15 - StorageDead(_3); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15 - StorageDead(_2); // scope 1 at $DIR/inline_retag.rs:+2:14: +2:15 - 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 - } -} diff --git a/src/test/mir-opt/inline/inline_retag.rs b/src/test/mir-opt/inline/inline_retag.rs deleted file mode 100644 index c6950f269..000000000 --- a/src/test/mir-opt/inline/inline_retag.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags: -Z span_free_formats -Z mir-emit-retag - -// Tests that MIR inliner fixes up `Retag`'s `fn_entry` flag - -fn main() { - println!("{}", bar()); -} - -// EMIT_MIR inline_retag.bar.Inline.after.mir -fn bar() -> bool { - let f = foo; - f(&1, &-1) -} - -#[inline(always)] -fn foo(x: &i32, y: &i32) -> bool { - *x == *y -} diff --git a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff deleted file mode 100644 index 969573ba3..000000000 --- a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff +++ /dev/null @@ -1,26 +0,0 @@ -- // MIR for `clone` before Inline -+ // 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:+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 ::clone - shim(fn(A, B))) { // at $DIR/inline_shims.rs:6:5: 6:14 -+ } - - bb0: { - 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 = ::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<'a> fn(&'a fn(A, B)) -> fn(A, B) {::clone}, val: Value() } -- } -- -- bb1: { -+ _0 = (*_2); // scope 1 at $SRC_DIR/core/src/clone.rs:LL:COL - 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 - } - } - diff --git a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff b/src/test/mir-opt/inline/inline_shims.drop.Inline.diff deleted file mode 100644 index 7a54beca2..000000000 --- a/src/test/mir-opt/inline/inline_shims.drop.Inline.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `drop` before Inline -+ // MIR for `drop` after Inline - - fn drop(_1: *mut Vec, _2: *mut Option) -> () { - 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; // in scope 0 at $DIR/inline_shims.rs:+1:38: +1:39 - let mut _5: *mut std::option::Option; // in scope 0 at $DIR/inline_shims.rs:+2:38: +2:39 - scope 1 { - } - scope 2 { -+ scope 3 (inlined std::ptr::drop_in_place::> - shim(Some(Option))) { // at $DIR/inline_shims.rs:12:14: 12:40 -+ let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL -+ let mut _7: isize; // in scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL -+ } - } - - bb0: { - 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::>(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) {std::ptr::drop_in_place::>}, val: Value() } - } - - bb1: { - 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::>(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) {std::ptr::drop_in_place::>}, val: Value() } -+ 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:+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: { -+ drop((((*_5) as Some).0: B)) -> bb2; // scope 3 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - } - } - diff --git a/src/test/mir-opt/inline/inline_shims.rs b/src/test/mir-opt/inline/inline_shims.rs deleted file mode 100644 index 7c8618f71..000000000 --- a/src/test/mir-opt/inline/inline_shims.rs +++ /dev/null @@ -1,13 +0,0 @@ -// ignore-wasm32-bare compiled with panic=abort by default -#![crate_type = "lib"] - -// EMIT_MIR inline_shims.clone.Inline.diff -pub fn clone(f: fn(A, B)) -> fn(A, B) { - f.clone() -} - -// EMIT_MIR inline_shims.drop.Inline.diff -pub fn drop(a: *mut Vec, b: *mut Option) { - unsafe { std::ptr::drop_in_place(a) } - unsafe { std::ptr::drop_in_place(b) } -} diff --git a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff deleted file mode 100644 index af08296ed..000000000 --- a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff +++ /dev/null @@ -1,28 +0,0 @@ -- // MIR for `main` before Inline -+ // MIR for `main` after Inline - - fn main() -> () { - let mut _0: (); // return place in scope 0 at $DIR/inline_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:+1:9: +1:10 - } -+ scope 2 (inlined as Foo>::bar) { // at $DIR/inline_specialization.rs:5:13: 5:38 -+ } - - bb0: { - StorageLive(_1); // scope 0 at $DIR/inline_specialization.rs:+1:9: +1:10 -- _1 = 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 { as Foo>::bar}, val: Value() } -- } -- -- 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:+0:11: +2:2 - StorageDead(_1); // scope 0 at $DIR/inline_specialization.rs:+2:1: +2:2 - return; // scope 0 at $DIR/inline_specialization.rs:+2:2: +2:2 - } - } - diff --git a/src/test/mir-opt/inline/inline_specialization.rs b/src/test/mir-opt/inline/inline_specialization.rs deleted file mode 100644 index 87275b4e5..000000000 --- a/src/test/mir-opt/inline/inline_specialization.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(specialization)] - -// EMIT_MIR inline_specialization.main.Inline.diff -fn main() { - let x = as Foo>::bar(); -} - -trait Foo { - fn bar() -> u32; -} - -impl Foo for Vec { - #[inline(always)] - default fn bar() -> u32 { 123 } -} diff --git a/src/test/mir-opt/inline/inline_trait_method.rs b/src/test/mir-opt/inline/inline_trait_method.rs deleted file mode 100644 index 74be53f55..000000000 --- a/src/test/mir-opt/inline/inline_trait_method.rs +++ /dev/null @@ -1,22 +0,0 @@ -// compile-flags: -Z span_free_formats - -fn main() { - println!("{}", test(&())); -} - -// EMIT_MIR inline_trait_method.test.Inline.after.mir -fn test(x: &dyn X) -> u32 { - x.y() -} - -trait X { - fn y(&self) -> u32 { - 1 - } -} - -impl X for () { - fn y(&self) -> u32 { - 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 deleted file mode 100644 index 637bf282a..000000000 --- a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir +++ /dev/null @@ -1,21 +0,0 @@ -// MIR for `test` after Inline - -fn test(_1: &dyn X) -> u32 { - 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:+1:5: +1:10 - _2 = &(*_1); // scope 0 at $DIR/inline_trait_method.rs:+1:5: +1:10 - _0 = ::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<'a> fn(&'a dyn X) -> u32 {::y}, val: Value() } - } - - bb1: { - 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.rs b/src/test/mir-opt/inline/inline_trait_method_2.rs deleted file mode 100644 index 378e71a25..000000000 --- a/src/test/mir-opt/inline/inline_trait_method_2.rs +++ /dev/null @@ -1,27 +0,0 @@ -// compile-flags: -Z span_free_formats -Z mir-opt-level=4 - -// EMIT_MIR inline_trait_method_2.test2.Inline.after.mir -fn test2(x: &dyn X) -> bool { - test(x) -} - -#[inline] -fn test(x: &dyn X) -> bool { - x.y() -} - -trait X { - fn y(&self) -> bool { - false - } -} - -impl X for () { - fn y(&self) -> bool { - true - } -} - -fn main() { - println!("Should be true: {}", test2(&())); -} 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 deleted file mode 100644 index 73aea719e..000000000 --- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir +++ /dev/null @@ -1,28 +0,0 @@ -// MIR for `test2` after Inline - -fn test2(_1: &dyn X) -> bool { - 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 - } - - bb0: { - 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 - _0 = ::y(move _2) -> bb1; // scope 1 at $DIR/inline_trait_method_2.rs:10:5: 10:10 - // mir::Constant - // + span: $DIR/inline_trait_method_2.rs:10:7: 10:8 - // + literal: Const { ty: for<'a> fn(&'a dyn X) -> bool {::y}, val: Value() } - } - - bb1: { - StorageDead(_2); // scope 0 at $DIR/inline_trait_method_2.rs:+1:11: +1:12 - return; // scope 0 at $DIR/inline_trait_method_2.rs:+2:2: +2:2 - } -} diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir deleted file mode 100644 index 777681e1c..000000000 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir +++ /dev/null @@ -1,30 +0,0 @@ -// 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:+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:+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:+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 - } -} 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 deleted file mode 100644 index 83545c991..000000000 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir +++ /dev/null @@ -1,38 +0,0 @@ -// MIR for `b` after Inline - -fn b(_1: &mut Box) -> &mut T { - 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; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined as AsMut>::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 - let mut _6: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - let mut _7: std::boxed::Box; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - let mut _8: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - } - - bb0: { - 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 - _7 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _8 = (((_7.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _6 = &mut (*_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - 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:+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 - } -} 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 deleted file mode 100644 index ed4e9927c..000000000 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir +++ /dev/null @@ -1,22 +0,0 @@ -// 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:+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:+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:+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 - } -} 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 deleted file mode 100644 index 18a2670be..000000000 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir +++ /dev/null @@ -1,26 +0,0 @@ -// MIR for `d` after Inline - -fn d(_1: &Box) -> &T { - 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; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15 - scope 1 (inlined as AsRef>::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; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - let mut _5: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - } - - bb0: { - 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 - _4 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _5 = (((_4.0: std::ptr::Unique).0: std::ptr::NonNull).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _2 = &(*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL - _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 - } -} diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs deleted file mode 100644 index 94f926d39..000000000 --- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs +++ /dev/null @@ -1,27 +0,0 @@ -// EMIT_MIR issue_58867_inline_as_ref_as_mut.a.Inline.after.mir -pub fn a(x: &mut [T]) -> &mut [T] { - x.as_mut() -} - -// EMIT_MIR issue_58867_inline_as_ref_as_mut.b.Inline.after.mir -pub fn b(x: &mut Box) -> &mut T { - x.as_mut() -} - -// EMIT_MIR issue_58867_inline_as_ref_as_mut.c.Inline.after.mir -pub fn c(x: &[T]) -> &[T] { - x.as_ref() -} - -// EMIT_MIR issue_58867_inline_as_ref_as_mut.d.Inline.after.mir -pub fn d(x: &Box) -> &T { - x.as_ref() -} - -fn main() { - let mut boxed = Box::new(1); - println!("{:?}", a(&mut [1])); - println!("{:?}", b(&mut boxed)); - println!("{:?}", c(&[1])); - println!("{:?}", d(&boxed)); -} 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 deleted file mode 100644 index d99ae1a6c..000000000 --- a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir +++ /dev/null @@ -1,42 +0,0 @@ -// MIR for `main` after Inline - -fn main() -> () { - 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:+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:+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:+1:23: +1:24 - } - } - } - - bb0: { - 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 - } -} diff --git a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs b/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs deleted file mode 100644 index 76d806acc..000000000 --- a/src/test/mir-opt/inline/issue_76997_inline_scopes_parenting.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Tests that MIR inliner can handle `SourceScopeData` parenting correctly. (#76997) - -// EMIT_MIR issue_76997_inline_scopes_parenting.main.Inline.after.mir -fn main() { - let f = |x| { let y = x; y }; - f(()) -} diff --git a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff deleted file mode 100644 index 51a98465f..000000000 --- a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff +++ /dev/null @@ -1,68 +0,0 @@ -- // MIR for `bar` before Inline -+ // MIR for `bar` after Inline - - fn bar(_1: P) -> () { - 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 >::call - shim(fn() {foo})) { // at $DIR/issue_78442.rs:11:5: 11:17 -+ } - - bb0: { - 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() } - } - - bb1: { - _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 = >::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<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> >::Output {>::call}, val: Value() } -+ _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $SRC_DIR/core/src/ops/function.rs:LL:COL - } - - bb2: { -- 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:+5:2: +5:2 -+ bb3 (cleanup): { -+ 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:+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:+0:1: +5:2 -+ bb5: { -+ 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 deleted file mode 100644 index e47466c5e..000000000 --- a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff +++ /dev/null @@ -1,57 +0,0 @@ -- // MIR for `bar` before RevealAll -+ // MIR for `bar` after RevealAll - - fn bar(_1: P) -> () { - 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:+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() } - } - - bb1: { - _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 = >::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue_78442.rs:+4:5: +4:17 -+ _2 = >::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<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> >::Output {>::call}, val: Value() } -+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> >::Output {>::call}, val: Value() } - } - - bb2: { - 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:+5:2: +5:2 - } - - bb4 (cleanup): { - drop(_1) -> bb5; // scope 0 at $DIR/issue_78442.rs:+5:1: +5:2 - } - - bb5 (cleanup): { - resume; // scope 0 at $DIR/issue_78442.rs:+0:1: +5:2 - } - } - diff --git a/src/test/mir-opt/inline/issue_78442.rs b/src/test/mir-opt/inline/issue_78442.rs deleted file mode 100644 index aa8ede2df..000000000 --- a/src/test/mir-opt/inline/issue_78442.rs +++ /dev/null @@ -1,20 +0,0 @@ -// compile-flags: -Z mir-opt-level=3 -Z inline-mir -// ignore-wasm32-bare compiled with panic=abort by default -#![crate_type = "lib"] - -// EMIT_MIR issue_78442.bar.RevealAll.diff -// EMIT_MIR issue_78442.bar.Inline.diff -pub fn bar

( - // Error won't happen if "bar" is not generic - _baz: P, -) { - hide_foo()(); -} - -fn hide_foo() -> impl Fn() { - // Error won't happen if "iterate" hasn't impl Trait or has generics - foo -} - -fn foo() { // Error won't happen if "foo" isn't used in "iterate" or has generics -} diff --git a/src/test/mir-opt/inline/polymorphic_recursion.rs b/src/test/mir-opt/inline/polymorphic_recursion.rs deleted file mode 100644 index 7388722b7..000000000 --- a/src/test/mir-opt/inline/polymorphic_recursion.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Make sure that the MIR inliner does not loop indefinitely on polymorphic recursion. -// compile-flags: --crate-type lib - -// Randomize `def_path_hash` by defining them under a module with different names -macro_rules! emit { - ($($m:ident)*) => {$( - pub mod $m { - pub trait Tr { type Next: Tr; } - - pub fn hoge() { - inner::(); - } - - #[inline(always)] - fn inner() - { - inner::(); - inner::(); - } - } - )*}; -} - -// Increase the chance of triggering the bug -emit!(m00 m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 m11 m12 m13 m14 m15 m16 m17 m18 m19); -- cgit v1.2.3