]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/remove-extern-crate.rs
Rollup merge of #54257 - alexcrichton:wasm-math-symbols, r=TimNN
[rust.git] / src / test / ui / rust-2018 / remove-extern-crate.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // run-rustfix
12 // edition:2018
13 // compile-pass
14 // aux-build:remove-extern-crate.rs
15 // compile-flags:--extern remove_extern_crate
16
17 #![warn(rust_2018_idioms)]
18
19 extern crate core;
20 extern crate core as another_name;
21 use remove_extern_crate;
22 #[macro_use]
23 extern crate remove_extern_crate as something_else;
24
25 fn main() {
26     another_name::mem::drop(3);
27     another::foo();
28     remove_extern_crate::foo!();
29     bar!();
30 }
31
32 mod another {
33     extern crate core;
34     use remove_extern_crate;
35
36     pub fn foo() {
37         core::mem::drop(4);
38         remove_extern_crate::foo!();
39     }
40 }