error[E0599]: no method named `a` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:67:7 | LL | struct S; | --------- method `a` not found for this ... LL | trait A { | ------- `method::A` defines an item `a` ... LL | S.a(); | ^ method not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope error[E0599]: no method named `b` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:68:7 | LL | struct S; | --------- method `b` not found for this ... LL | fn b(&self) { } | - | | | the method is available for `std::boxed::Box` here | the method is available for `std::sync::Arc` here | the method is available for `std::rc::Rc` here ... LL | S.b(); | ^ method not found in `S` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use method::B; | error[E0624]: method `a` is private --> $DIR/trait-item-privacy.rs:72:7 | LL | c.a(); | ^ error[E0599]: no function or associated item named `a` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:78:8 | LL | struct S; | --------- function or associated item `a` not found for this ... LL | trait A { | ------- `method::A` defines an item `a` ... LL | S::a(&S); | ^ function or associated item not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope error[E0599]: no function or associated item named `b` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:80:8 | LL | struct S; | --------- function or associated item `b` not found for this ... LL | S::b(&S); | ^ function or associated item not found in `S` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use method::B; | error[E0624]: method `a` is private --> $DIR/trait-item-privacy.rs:84:5 | LL | C::a(&S); | ^^^^ error[E0599]: no associated item named `A` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:97:8 | LL | struct S; | --------- associated item `A` not found for this ... LL | trait A { | ------- `assoc_const::A` defines an item `A` ... LL | S::A; | ^ associated item not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope error[E0599]: no associated item named `B` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:98:8 | LL | struct S; | --------- associated item `B` not found for this ... LL | S::B; | ^ associated item not found in `S` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | LL | use assoc_const::B; | error[E0624]: associated constant `A` is private --> $DIR/trait-item-privacy.rs:101:5 | LL | C::A; | ^^^^ error[E0038]: the trait `assoc_const::C` cannot be made into an object --> $DIR/trait-item-privacy.rs:101:5 | LL | const A: u8 = 0; | - ...because it contains this associated `const` ... LL | const B: u8 = 0; | - ...because it contains this associated `const` ... LL | pub trait C: A + B { | - this trait cannot be made into an object... LL | const C: u8 = 0; | - ...because it contains this associated `const` ... LL | C::A; | ^^^^ the trait `assoc_const::C` cannot be made into an object | = help: consider moving `C` to another trait = help: consider moving `B` to another trait = help: consider moving `A` to another trait error[E0223]: ambiguous associated type --> $DIR/trait-item-privacy.rs:115:12 | LL | let _: S::A; | ^^^^ help: use fully-qualified syntax: `::A` error[E0223]: ambiguous associated type --> $DIR/trait-item-privacy.rs:116:12 | LL | let _: S::B; | ^^^^ help: use fully-qualified syntax: `::B` error[E0223]: ambiguous associated type --> $DIR/trait-item-privacy.rs:117:12 | LL | let _: S::C; | ^^^^ help: use fully-qualified syntax: `::C` error: associated type `A` is private --> $DIR/trait-item-privacy.rs:119:12 | LL | let _: T::A; | ^^^^ error: associated type `A` is private --> $DIR/trait-item-privacy.rs:128:9 | LL | A = u8, | ^^^^^^ error: aborting due to 15 previous errors Some errors have detailed explanations: E0038, E0223, E0599, E0624. For more information about an error, try `rustc --explain E0038`.