]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs
Prohibit macro-expanded `extern crate` items shadowing crates passed with `--extern`
[rust.git] / src / test / ui / feature-gates / feature-gate-extern_crate_item_prelude.rs
1 // edition:2018
2
3 #![feature(alloc)]
4
5 extern crate alloc;
6
7 mod in_scope {
8     fn check() {
9         let v = alloc::vec![0];
10         //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
11         type A = alloc::boxed::Box<u8>;
12         //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
13     }
14 }
15
16 mod absolute {
17     fn check() {
18         let v = ::alloc::vec![0];
19         //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
20         type A = ::alloc::boxed::Box<u8>;
21         //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
22     }
23 }
24
25 mod import_in_scope {
26     use alloc;
27     //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
28     use alloc::boxed;
29     //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
30 }
31
32 mod import_absolute {
33     use ::alloc;
34     //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
35     use ::alloc::boxed;
36     //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
37 }
38
39 extern crate alloc as core;
40
41 mod unrelated_crate_renamed {
42     type A = core::boxed::Box<u8>;
43     //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
44 }
45
46 fn main() {}