1 struct SemiPriv;
2 
3 mod m1 {
4     struct Priv;
5     impl ::SemiPriv {
f(_: Priv)6         pub fn f(_: Priv) {} //~ WARN private type `m1::Priv` in public interface
7         //~^ WARNING hard error
8     }
9 
10     impl Priv {
f(_: 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
deref(&self) -> &Self::Target19         fn deref(&self) -> &Self::Target { unimplemented!() }
20     }
21 
22     impl ::std::ops::Deref for Priv {
23         type Target = Priv; // ok
deref(&self) -> &Self::Target24         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 
main()39 fn main() {}
40