4 // aux-build:remove-extern-crate.rs
5 // compile-flags:--extern remove_extern_crate
7 #![warn(rust_2018_idioms)]
9 //~ WARNING unused extern crate
10 // Shouldn't suggest changing to `use`, as `another_name`
11 // would no longer be added to the prelude which could cause
12 // compilation errors for imports that use `another_name` in other
13 // modules. See #57672.
14 extern crate core as another_name;
15 use remove_extern_crate;
17 extern crate remove_extern_crate as something_else;
19 // Shouldn't suggest changing to `use`, as the `alloc`
20 // crate is not in the extern prelude - see #54381.
24 another_name::mem::drop(3);
26 remove_extern_crate::foo!();
32 use core; //~ WARNING `extern crate` is not idiomatic
33 use remove_extern_crate;
37 remove_extern_crate::foo!();