]> git.lizzy.rs Git - rust.git/blob - src/test/ui-fulldeps/unnecessary-extern-crate.rs
Rollup merge of #50464 - est31:master, r=rkruppe
[rust.git] / src / test / ui-fulldeps / unnecessary-extern-crate.rs
1 // Copyright 2015 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 #![deny(unnecessary_extern_crate)]
12 #![feature(alloc, test, libc)]
13
14 extern crate alloc;
15 //~^ ERROR `extern crate` is unnecessary in the new edition
16 //~| HELP remove
17 extern crate alloc as x;
18 //~^ ERROR `extern crate` is unnecessary in the new edition
19 //~| HELP use `use`
20
21 #[macro_use]
22 extern crate test;
23 pub extern crate test as y;
24 //~^ ERROR `extern crate` is unnecessary in the new edition
25 //~| HELP use `pub use`
26 pub extern crate libc;
27 //~^ ERROR `extern crate` is unnecessary in the new edition
28 //~| HELP use `pub use`
29
30
31 mod foo {
32     extern crate alloc;
33     //~^ ERROR `extern crate` is unnecessary in the new edition
34     //~| HELP use `use`
35     extern crate alloc as x;
36     //~^ ERROR `extern crate` is unnecessary in the new edition
37     //~| HELP use `use`
38     pub extern crate test;
39     //~^ ERROR `extern crate` is unnecessary in the new edition
40     //~| HELP use `pub use`
41     pub extern crate test as y;
42     //~^ ERROR `extern crate` is unnecessary in the new edition
43     //~| HELP use `pub use`
44     mod bar {
45         extern crate alloc;
46         //~^ ERROR `extern crate` is unnecessary in the new edition
47         //~| HELP use `use`
48         extern crate alloc as x;
49         //~^ ERROR `extern crate` is unnecessary in the new edition
50         //~| HELP use `use`
51     }
52 }
53
54
55 fn main() {}