]> git.lizzy.rs Git - rust.git/blob - tests/ui/imports/glob-resolve1.rs
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / tests / ui / imports / 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 "C" {
9         fn epriv();
10     }
11     enum A {
12         A1,
13     }
14     pub enum B {
15         B1,
16     }
17
18     struct C;
19
20     type D = isize;
21 }
22
23 fn foo<T>() {}
24
25 fn main() {
26     fpriv(); //~ ERROR cannot find function `fpriv` in this scope
27     epriv(); //~ ERROR cannot find function `epriv` in this scope
28     B; //~ ERROR expected value, found enum `B`
29     C; //~ ERROR cannot find value `C` in this scope
30     import(); //~ ERROR: cannot find function `import` in this scope
31
32     foo::<A>(); //~ ERROR: cannot find type `A` in this scope
33     foo::<C>(); //~ ERROR: cannot find type `C` in this scope
34     foo::<D>(); //~ ERROR: cannot find type `D` in this scope
35 }
36
37 mod other {
38     pub fn import() {}
39 }