2018-08-24 16:00:15 -05:00
|
|
|
// run-rustfix
|
|
|
|
// edition:2018
|
|
|
|
// compile-pass
|
|
|
|
// aux-build:remove-extern-crate.rs
|
2018-09-10 11:41:30 -05:00
|
|
|
// compile-flags:--extern remove_extern_crate
|
2018-08-24 16:00:15 -05:00
|
|
|
|
|
|
|
#![warn(rust_2018_idioms)]
|
|
|
|
|
|
|
|
extern crate core;
|
2019-04-25 02:06:49 -05:00
|
|
|
// 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
|
|
|
|
// modules. See #57672.
|
2018-08-24 16:00:15 -05:00
|
|
|
extern crate core as another_name;
|
|
|
|
use remove_extern_crate;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate remove_extern_crate as something_else;
|
|
|
|
|
2018-09-28 14:54:18 -05:00
|
|
|
// Shouldn't suggest changing to `use`, as the `alloc`
|
|
|
|
// crate is not in the extern prelude - see #54381.
|
|
|
|
extern crate alloc;
|
|
|
|
|
2018-08-24 16:00:15 -05:00
|
|
|
fn main() {
|
|
|
|
another_name::mem::drop(3);
|
|
|
|
another::foo();
|
|
|
|
remove_extern_crate::foo!();
|
|
|
|
bar!();
|
2018-09-28 14:54:18 -05:00
|
|
|
alloc::vec![5];
|
2018-08-24 16:00:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
mod another {
|
|
|
|
extern crate core;
|
|
|
|
use remove_extern_crate;
|
|
|
|
|
|
|
|
pub fn foo() {
|
|
|
|
core::mem::drop(4);
|
|
|
|
remove_extern_crate::foo!();
|
|
|
|
}
|
|
|
|
}
|