]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rust-2018/remove-extern-crate.fixed
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / rust-2018 / remove-extern-crate.fixed
CommitLineData
b7449926 1// run-rustfix
8faf50e0 2// edition:2018
416331ca 3// build-pass (FIXME(62277): could be check-pass?)
b7449926
XL
4// aux-build:remove-extern-crate.rs
5// compile-flags:--extern remove_extern_crate
1a4d82fc 6
b7449926 7#![warn(rust_2018_idioms)]
94b46f34 8
60c5eb7d 9 //~ WARNING unused extern crate
48663c56
XL
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.
14extern crate core as another_name;
b7449926 15use remove_extern_crate;
94b46f34 16#[macro_use]
b7449926 17extern crate remove_extern_crate as something_else;
94b46f34 18
4462d4a0
XL
19// Shouldn't suggest changing to `use`, as the `alloc`
20// crate is not in the extern prelude - see #54381.
21extern crate alloc;
22
b7449926
XL
23fn main() {
24 another_name::mem::drop(3);
25 another::foo();
26 remove_extern_crate::foo!();
27 bar!();
4462d4a0 28 alloc::vec![5];
83c7162d 29}
9e0c209e 30
b7449926 31mod another {
60c5eb7d 32 use core; //~ WARNING `extern crate` is not idiomatic
b7449926
XL
33 use remove_extern_crate;
34
35 pub fn foo() {
36 core::mem::drop(4);
37 remove_extern_crate::foo!();
38 }
39}