1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
pub mod test { pub struct A; pub struct B; pub struct Foo<T>(T); impl Foo<A> { fn foo() {} } impl Foo<B> { fn foo() {} } } fn main() { test::Foo::<test::B>::foo(); //~ ERROR associated function `foo` is private }