diff options
| author | Jieyou Xu <jieyouxu@outlook.com> | 2025-07-21 16:58:54 +0800 |
|---|---|---|
| committer | Jieyou Xu <jieyouxu@outlook.com> | 2025-07-21 16:58:54 +0800 |
| commit | 74ba9cbae4306acf0f4ee34abb6762e05446abc4 (patch) | |
| tree | 26df4fe109d832d7c7e872045d6463214969c74a | |
| parent | 460259d14de0274b97b8801e08cb2fe5f16fdac5 (diff) | |
| download | rust-74ba9cbae4306acf0f4ee34abb6762e05446abc4.tar.gz rust-74ba9cbae4306acf0f4ee34abb6762e05446abc4.zip | |
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.
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 26c1c9015da..028f86eb0a3 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 c5b629fa90b..1acf531a661 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 0e834707bf9..632ecd62322 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 + | |
