about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/build_system/tests.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-04-23 09:37:28 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-04-23 09:37:28 +0000
commit3d682cfb66997e8cd5323e728fd77fc26b17fdd4 (patch)
tree5546f1a9f7aa30316196b4d3fc1a5417d5b749f5 /compiler/rustc_codegen_cranelift/build_system/tests.rs
parentc67277301c896857d0534f2bb7431680796833fb (diff)
parentde5d6523738fd44a0521b6abf3e73ae1df210741 (diff)
downloadrust-3d682cfb66997e8cd5323e728fd77fc26b17fdd4.tar.gz
rust-3d682cfb66997e8cd5323e728fd77fc26b17fdd4.zip
Merge commit 'de5d6523738fd44a0521b6abf3e73ae1df210741' into sync_cg_clif-2024-04-23
Diffstat (limited to 'compiler/rustc_codegen_cranelift/build_system/tests.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/build_system/tests.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_cranelift/build_system/tests.rs b/compiler/rustc_codegen_cranelift/build_system/tests.rs
index 9efb6ed715c..76104901474 100644
--- a/compiler/rustc_codegen_cranelift/build_system/tests.rs
+++ b/compiler/rustc_codegen_cranelift/build_system/tests.rs
@@ -290,7 +290,7 @@ pub(crate) fn run_tests(
         && !skip_tests.contains(&"testsuite.extended_sysroot");
 
     if run_base_sysroot || run_extended_sysroot {
-        let mut target_compiler = build_sysroot::build_sysroot(
+        let target_compiler = build_sysroot::build_sysroot(
             dirs,
             channel,
             sysroot_kind,
@@ -299,11 +299,8 @@ pub(crate) fn run_tests(
             rustup_toolchain_name,
             target_triple.clone(),
         );
-        // Rust's build system denies a couple of lints that trigger on several of the test
-        // projects. Changing the code to fix them is not worth it, so just silence all lints.
-        target_compiler.rustflags.push("--cap-lints=allow".to_owned());
 
-        let runner = TestRunner::new(
+        let mut runner = TestRunner::new(
             dirs.clone(),
             target_compiler,
             use_unstable_features,
@@ -319,6 +316,9 @@ pub(crate) fn run_tests(
         }
 
         if run_extended_sysroot {
+            // Rust's build system denies a couple of lints that trigger on several of the test
+            // projects. Changing the code to fix them is not worth it, so just silence all lints.
+            runner.target_compiler.rustflags.push("--cap-lints=allow".to_owned());
             runner.run_testsuite(EXTENDED_SYSROOT_SUITE);
         } else {
             eprintln!("[SKIP] extended_sysroot tests");