rust/src/test/ui/traits/trait-item-privacy.stderr

159 lines
4.8 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0599]: no method named `a` found for type `S` in the current scope
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:67:7
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- method `a` not found for this
...
2019-03-09 06:03:44 -06:00
LL | S.a();
| ^ method not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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`
error[E0599]: no method named `b` found for type `S` in the current scope
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:68:7
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- method `b` not found for this
...
LL | fn b(&self) { }
| -
| |
| the method is available for `std::boxed::Box<S>` here
| the method is available for `std::sync::Arc<S>` here
| the method is available for `std::rc::Rc<S>` here
...
2019-03-09 06:03:44 -06:00
LL | S.b();
| ^ method not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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:
2018-08-08 07:28:26 -05:00
|
LL | use method::B;
|
error[E0624]: method `a` is private
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:72:7
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | c.a();
2018-08-08 07:28:26 -05:00
| ^
error[E0599]: no function or associated item named `a` found for type `S` in the current scope
2018-12-07 12:15:36 -06:00
--> $DIR/trait-item-privacy.rs:78:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- function or associated item `a` not found for this
...
LL | S::a(&S);
2019-03-10 18:20:15 -05:00
| ^ function or associated item not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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`
error[E0599]: no function or associated item named `b` found for type `S` in the current scope
2018-12-07 12:15:36 -06:00
--> $DIR/trait-item-privacy.rs:80:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- function or associated item `b` not found for this
...
LL | S::b(&S);
2019-03-10 18:20:15 -05:00
| ^ function or associated item not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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:
2018-08-08 07:28:26 -05:00
|
LL | use method::B;
|
error[E0624]: method `a` is private
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:84:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | C::a(&S);
2018-08-08 07:28:26 -05:00
| ^^^^
error[E0599]: no associated item named `A` found for type `S` in the current scope
2018-12-07 12:15:36 -06:00
--> $DIR/trait-item-privacy.rs:97:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- associated item `A` not found for this
...
2019-03-09 06:03:44 -06:00
LL | S::A;
2019-03-10 18:20:15 -05:00
| ^ associated item not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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`
error[E0599]: no associated item named `B` found for type `S` in the current scope
2018-12-07 12:15:36 -06:00
--> $DIR/trait-item-privacy.rs:98:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
| --------- associated item `B` not found for this
...
2019-03-09 06:03:44 -06:00
LL | S::B;
2019-03-10 18:20:15 -05:00
| ^ associated item not found in `S`
2018-08-08 07:28:26 -05:00
|
= 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:
2018-08-08 07:28:26 -05:00
|
LL | use assoc_const::B;
|
error[E0624]: associated constant `A` is private
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:101:5
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | C::A;
2018-08-08 07:28:26 -05:00
| ^^^^
error[E0038]: the trait `assoc_const::C` cannot be made into an object
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:101:5
2018-08-08 07:28:26 -05:00
|
LL | const A: u8 = 0;
| - the trait cannot contain associated consts like `A`
...
LL | const B: u8 = 0;
| - the trait cannot contain associated consts like `B`
...
LL | const C: u8 = 0;
| - the trait cannot contain associated consts like `C`
...
2019-03-09 06:03:44 -06:00
LL | C::A;
2018-08-08 07:28:26 -05:00
| ^^^^ the trait `assoc_const::C` cannot be made into an object
error[E0223]: ambiguous associated type
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:115:12
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _: S::A;
| ^^^^ help: use fully-qualified syntax: `<S as Trait>::A`
2018-08-08 07:28:26 -05:00
error[E0223]: ambiguous associated type
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:116:12
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _: S::B;
| ^^^^ help: use fully-qualified syntax: `<S as Trait>::B`
2018-08-08 07:28:26 -05:00
error[E0223]: ambiguous associated type
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:117:12
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _: S::C;
| ^^^^ help: use fully-qualified syntax: `<S as Trait>::C`
2018-08-08 07:28:26 -05:00
error: associated type `A` is private
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:119:12
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _: T::A;
2018-08-08 07:28:26 -05:00
| ^^^^
error: associated type `A` is private
2018-12-25 09:56:47 -06:00
--> $DIR/trait-item-privacy.rs:128:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | A = u8,
2018-08-08 07:28:26 -05:00
| ^^^^^^
error: aborting due to 15 previous errors
2018-08-08 07:28:26 -05:00
Some errors have detailed explanations: E0038, E0223, E0599, E0624.
2018-08-08 07:28:26 -05:00
For more information about an error, try `rustc --explain E0038`.