]> git.proxmox.com Git - rustc.git/blob - src/test/ui/glob-resolve1.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / ui / glob-resolve1.rs
1 // Make sure that globs only bring in public things.
2
3 use bar::*;
4
5 mod bar {
6 use self::fpriv as import;
7 fn fpriv() {}
8 extern {
9 fn epriv();
10 }
11 enum A { A1 }
12 pub enum B { B1 }
13
14 struct C;
15
16 type D = isize;
17 }
18
19 fn foo<T>() {}
20
21 fn main() {
22 fpriv(); //~ ERROR cannot find function `fpriv` in this scope
23 epriv(); //~ ERROR cannot find function `epriv` in this scope
24 B; //~ ERROR expected value, found enum `B`
25 C; //~ ERROR cannot find value `C` in this scope
26 import(); //~ ERROR: cannot find function `import` in this scope
27
28 foo::<A>(); //~ ERROR: cannot find type `A` in this scope
29 foo::<C>(); //~ ERROR: cannot find type `C` in this scope
30 foo::<D>(); //~ ERROR: cannot find type `D` in this scope
31 }
32
33 mod other {
34 pub fn import() {}
35 }