From 74ba9cbae4306acf0f4ee34abb6762e05446abc4 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Mon, 21 Jul 2025 16:58:54 +0800 Subject: [PATCH] Don't use another main test file as auxiliary In this case, the exact extern crate isn't very important. This is part of the changes needed to address the spurious failures from a main test `../removing-extern-crate.rs` being both an auxiliary and a main test file, causing fs races due to multiple `rustc` processes in multiple test threads trying to build the main test file both as a main test and also as an auxiliary at around the same time. --- .../removing-extern-crate-malformed-cfg.fixed | 2 +- .../rust-2018/removing-extern-crate-malformed-cfg.rs | 6 +++--- .../removing-extern-crate-malformed-cfg.stderr | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed index 26c1c9015da8e..028f86eb0a3ed 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.fixed @@ -1,5 +1,5 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs index c5b629fa90b7a..1acf531a66196 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs @@ -1,16 +1,16 @@ //@ edition:2018 -//@ aux-build:../removing-extern-crate.rs +//@ aux-build: remove-extern-crate.rs //@ run-rustfix #![warn(rust_2018_idioms)] #[cfg_attr(test, "macro_use")] //~ ERROR expected -extern crate removing_extern_crate as foo; //~ WARNING unused extern crate +extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate mod another { #[cfg_attr(test)] //~ ERROR expected - extern crate removing_extern_crate as foo; //~ WARNING unused extern crate + extern crate remove_extern_crate as foo; //~ WARNING unused extern crate extern crate core; //~ WARNING unused extern crate } diff --git a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr index 0e834707bf9b8..632ecd6232213 100644 --- a/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr +++ b/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.stderr @@ -19,8 +19,8 @@ LL | #[cfg_attr(test)] warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:8:1 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate-malformed-cfg.rs:5:9 @@ -31,7 +31,7 @@ LL | #![warn(rust_2018_idioms)] help: remove the unused `extern crate` | LL - #[cfg_attr(test, "macro_use")] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + | @@ -50,13 +50,13 @@ LL + warning: unused extern crate --> $DIR/removing-extern-crate-malformed-cfg.rs:13:5 | -LL | extern crate removing_extern_crate as foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused +LL | extern crate remove_extern_crate as foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | help: remove the unused `extern crate` | LL - #[cfg_attr(test)] -LL - extern crate removing_extern_crate as foo; +LL - extern crate remove_extern_crate as foo; LL + |