]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/privacy3.rs
Rollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum
[rust.git] / tests / ui / privacy / privacy3.rs
1 #![feature(start, no_core)]
2 #![no_core] // makes debugging this test *a lot* easier (during resolve)
3
4 // Test to make sure that private items imported through globs remain private
5 // when  they're used.
6
7 mod bar {
8     pub use self::glob::*;
9
10     mod glob {
11         fn gpriv() {}
12     }
13 }
14
15 pub fn foo() {}
16
17 fn test1() {
18     use bar::gpriv;
19     //~^ ERROR unresolved import `bar::gpriv` [E0432]
20     //~| no `gpriv` in `bar`
21
22     // This should pass because the compiler will insert a fake name binding
23     // for `gpriv`
24     gpriv();
25 }
26
27 #[start] fn main(_: isize, _: *const *const u8) -> isize { 3 }