]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/remove-extern-crate.rs
Rollup merge of #59856 - albins:update-polonius, r=nikomatsakis
[rust.git] / src / test / ui / rust-2018 / remove-extern-crate.rs
1 // run-rustfix
2 // edition:2018
3 // compile-pass
4 // aux-build:remove-extern-crate.rs
5 // compile-flags:--extern remove_extern_crate
6
7 #![warn(rust_2018_idioms)]
8
9 extern crate core;
10 extern crate core as another_name;
11 use remove_extern_crate;
12 #[macro_use]
13 extern crate remove_extern_crate as something_else;
14
15 // Shouldn't suggest changing to `use`, as the `alloc`
16 // crate is not in the extern prelude - see #54381.
17 extern crate alloc;
18
19 fn main() {
20     another_name::mem::drop(3);
21     another::foo();
22     remove_extern_crate::foo!();
23     bar!();
24     alloc::vec![5];
25 }
26
27 mod another {
28     extern crate core;
29     use remove_extern_crate;
30
31     pub fn foo() {
32         core::mem::drop(4);
33         remove_extern_crate::foo!();
34     }
35 }