]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/issue-30079.rs
Rollup merge of #92467 - Aaron1011:extern-local-region, r=oli-obk
[rust.git] / src / test / ui / privacy / issue-30079.rs
1 struct SemiPriv;
2
3 mod m1 {
4     struct Priv;
5     impl ::SemiPriv {
6         pub fn f(_: Priv) {} //~ WARN private type `m1::Priv` in public interface
7         //~^ WARNING hard error
8     }
9
10     impl Priv {
11         pub fn f(_: Priv) {} // ok
12     }
13 }
14
15 mod m2 {
16     struct Priv;
17     impl ::std::ops::Deref for ::SemiPriv {
18         type Target = Priv; //~ ERROR private type `m2::Priv` in public interface
19         fn deref(&self) -> &Self::Target { unimplemented!() }
20     }
21
22     impl ::std::ops::Deref for Priv {
23         type Target = Priv; // ok
24         fn deref(&self) -> &Self::Target { unimplemented!() }
25     }
26 }
27
28 trait SemiPrivTrait {
29     type Assoc;
30 }
31
32 mod m3 {
33     struct Priv;
34     impl ::SemiPrivTrait for () {
35         type Assoc = Priv; //~ ERROR private type `m3::Priv` in public interface
36     }
37 }
38
39 fn main() {}