rust/tests/ui/rust-2018/removing-extern-crate-malformed-cfg.rs
Jieyou Xu 74ba9cbae4
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.
2025-07-21 16:58:54 +08:00

18 lines
478 B
Rust

//@ edition:2018
//@ aux-build: remove-extern-crate.rs
//@ run-rustfix
#![warn(rust_2018_idioms)]
#[cfg_attr(test, "macro_use")] //~ ERROR expected
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 remove_extern_crate as foo; //~ WARNING unused extern crate
extern crate core; //~ WARNING unused extern crate
}
fn main() {}