mod m { struct Priv; pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak` } trait Trait { type A; } impl Trait for u8 { type A = u8; } fn check() -> ::A { //~^ ERROR: `Priv` is private 0 } trait Trait2 { type A; } impl Trait2 for u8 { type A = m::Leak; //~^ ERROR: `Priv` is private //~| ERROR: private type `Priv` in public interface } fn check2() -> ::A { //~^ ERROR: `Priv` is private todo!() } trait Trait3 { type A; } impl Trait3 for u8 { type A = T::A; //~^ ERROR: `Priv` is private //~| ERROR: private type `Priv` in public interface } fn check3() -> ::A { todo!() } trait Trait4 { type A; } impl Trait4 for u8 { type A = T::A; } fn check4() -> ::A { todo!() } fn main() {}