| ^ method not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
- = note: the following trait defines an item `a`, perhaps you need to implement it:
- candidate #1: `method::A`
+note: `method::A` defines an item `a`, perhaps you need to implement it
+ --> $DIR/trait-item-privacy.rs:6:5
+ |
+LL | trait A {
+ | ^^^^^^^
error[E0599]: no method named `b` found for struct `S` in the current scope
--> $DIR/trait-item-privacy.rs:68:7
| ^ function or associated item not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
- = note: the following trait defines an item `a`, perhaps you need to implement it:
- candidate #1: `method::A`
+note: `method::A` defines an item `a`, perhaps you need to implement it
+ --> $DIR/trait-item-privacy.rs:6:5
+ |
+LL | trait A {
+ | ^^^^^^^
error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
--> $DIR/trait-item-privacy.rs:80:8
| ^ associated item not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
- = note: the following trait defines an item `A`, perhaps you need to implement it:
- candidate #1: `assoc_const::A`
+note: `assoc_const::A` defines an item `A`, perhaps you need to implement it
+ --> $DIR/trait-item-privacy.rs:24:5
+ |
+LL | trait A {
+ | ^^^^^^^
error[E0599]: no associated item named `B` found for struct `S` in the current scope
--> $DIR/trait-item-privacy.rs:98:8
--> $DIR/trait-item-privacy.rs:101:5
|
LL | const A: u8 = 0;
- | - the trait cannot contain associated consts like `A`
+ | - ...because it contains this associated `const`
...
LL | const B: u8 = 0;
- | - the trait cannot contain associated consts like `B`
+ | - ...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;
- | - the trait cannot contain associated consts like `C`
+ | - ...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