diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index e1a1c416ae9..baf1b5a4a1a 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1470,7 +1470,6 @@ fn run(self, builder: &Builder<'_>) { }; if builder.config.cmd.bless() { - crate::utils::cc_detect::find_target(builder, self.compiler.host); // All that we really need to do is cover all combinations of 32/64-bit and unwind/abort, // but while we're at it we might as well flex our cross-compilation support. This // selection covers all our tier 1 operating systems and architectures using only tier diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 00ebd91f387..ed1c559e1f6 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2468,7 +2468,6 @@ fn make_compile_args( "-Zlint-mir", "-Zdump-mir-exclude-pass-number", "--crate-type=rlib", - "-Clink-dead-code", ]); if let Some(pass) = &self.props.mir_unit_test { rustc.args(&["-Zmir-opt-level=0", &format!("-Zmir-enable-passes=+{}", pass)]); diff --git a/tests/mir-opt/fn_ptr_shim.rs b/tests/mir-opt/fn_ptr_shim.rs index c82260baefe..2650cbf9704 100644 --- a/tests/mir-opt/fn_ptr_shim.rs +++ b/tests/mir-opt/fn_ptr_shim.rs @@ -5,7 +5,7 @@ // (as only `FnDef` and `FnPtr` callees are allowed in MIR). // EMIT_MIR core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir -fn main() { +pub fn main() { call(noop as fn()); } diff --git a/tests/mir-opt/retag.rs b/tests/mir-opt/retag.rs index 1e4b017dad5..554b8ece90f 100644 --- a/tests/mir-opt/retag.rs +++ b/tests/mir-opt/retag.rs @@ -28,7 +28,7 @@ fn drop(&mut self) {} // EMIT_MIR retag.main.SimplifyCfg-elaborate-drops.after.mir // EMIT_MIR retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir -fn main() { +pub fn main() { let mut x = 0; { let v = Test(0).foo(&mut x); // just making sure we do not panic when there is a tuple struct ctor diff --git a/tests/mir-opt/slice_drop_shim.rs b/tests/mir-opt/slice_drop_shim.rs index cac0a349128..037e048b3b7 100644 --- a/tests/mir-opt/slice_drop_shim.rs +++ b/tests/mir-opt/slice_drop_shim.rs @@ -1,6 +1,8 @@ // skip-filecheck -// compile-flags: -Zmir-opt-level=0 - +// compile-flags: -Zmir-opt-level=0 -Clink-dead-code +// mir-opt tests are always built as rlibs so that they seamlessly cross-compile, +// so this test only produces MIR for the drop_in_place we're looking for +// if we use -Clink-dead-code. // EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir fn main() { diff --git a/tests/mir-opt/unusual_item_types.rs b/tests/mir-opt/unusual_item_types.rs index 49b663b4f82..fa6ba515473 100644 --- a/tests/mir-opt/unusual_item_types.rs +++ b/tests/mir-opt/unusual_item_types.rs @@ -23,7 +23,7 @@ enum E { V = 5, } -fn main() { +pub fn main() { let f = Test::X as fn(usize) -> Test; // EMIT_MIR core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir let v = Vec::::new();