]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/privacy-in-paths.rs
Rollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum
[rust.git] / tests / ui / privacy / privacy-in-paths.rs
1 mod foo {
2     pub use self::bar::S;
3     mod bar {
4         pub struct S;
5         pub use baz;
6     }
7
8     trait T {
9         type Assoc;
10     }
11     impl T for () {
12         type Assoc = S;
13     }
14 }
15
16 impl foo::S {
17     fn f() {}
18 }
19
20 pub mod baz {
21     fn f() {}
22
23     fn g() {
24         ::foo::bar::baz::f(); //~ERROR module `bar` is private
25         ::foo::bar::S::f(); //~ERROR module `bar` is private
26         <() as ::foo::T>::Assoc::f(); //~ERROR trait `T` is private
27     }
28 }
29
30 fn main() {}