| //@ aux-build:remove-extern-crate.rs |
| //@ compile-flags:--extern remove_extern_crate |
| #![warn(rust_2018_idioms)] |
| #![allow(dropping_copy_types)] |
| #![allow(unused_imports)] |
| //~ WARNING unused extern crate |
| // Shouldn't suggest changing to `use`, as `another_name` |
| // would no longer be added to the prelude which could cause |
| // compilation errors for imports that use `another_name` in other |
| extern crate core as another_name; |
| extern crate remove_extern_crate as something_else; |
| // Shouldn't suggest changing to `use`, as the `alloc` |
| // crate is not in the extern prelude - see #54381. |
| another_name::mem::drop(3); |
| remove_extern_crate::foo!(); |
| use core; //~ WARNING `extern crate` is not idiomatic |
| remove_extern_crate::foo!(); |
| pub use core; //~ WARNING `extern crate` is not idiomatic |
| remove_extern_crate::foo!(); |