2020-01-08 16:05:31 +00:00
error[E0599]: no method named `a` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:67:7
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- method `a` not found for this struct
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | S.a();
2019-09-06 19:00:07 +00:00
| ^ method not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is implemented and in scope
2020-02-25 02:55:51 +00:00
note: `method::A` defines an item `a`, perhaps you need to implement it
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:6:5
2020-02-25 02:55:51 +00:00
|
LL | trait A {
| ^^^^^^^
2018-08-08 12:28:26 +00:00
2020-01-08 16:05:31 +00:00
error[E0599]: no method named `b` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:68:7
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- method `b` not found for this struct
2018-08-08 12:28:26 +00:00
...
2021-04-24 01:24:02 +00:00
LL | fn b(&self) { }
| - the method is available for `S` here
...
2019-03-09 12:03:44 +00:00
LL | S.b();
2019-09-06 19:00:07 +00:00
| ^ method not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is in scope
2019-09-29 23:58:05 +00:00
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
2018-08-08 12:28:26 +00:00
|
2023-03-18 02:18:39 +00:00
LL + use method::B;
2018-08-08 12:28:26 +00:00
|
2023-02-21 21:11:08 +00:00
error[E0624]: method `a` is private
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:72:7
2018-08-08 12:28:26 +00:00
|
2021-07-17 18:13:50 +00:00
LL | fn a(&self) { }
2023-02-21 21:11:08 +00:00
| ----------- private method defined here
2021-07-17 18:13:50 +00:00
...
2019-03-09 12:03:44 +00:00
LL | c.a();
2023-02-21 21:11:08 +00:00
| ^ private method
2018-08-08 12:28:26 +00:00
2020-01-08 16:05:31 +00:00
error[E0599]: no function or associated item named `a` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:78:8
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- function or associated item `a` not found for this struct
2018-08-08 12:28:26 +00:00
...
LL | S::a(&S);
2019-03-10 23:20:15 +00:00
| ^ function or associated item not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is implemented and in scope
2020-02-25 02:55:51 +00:00
note: `method::A` defines an item `a`, perhaps you need to implement it
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:6:5
2020-02-25 02:55:51 +00:00
|
LL | trait A {
| ^^^^^^^
2018-08-08 12:28:26 +00:00
2020-01-08 16:05:31 +00:00
error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:80:8
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- function or associated item `b` not found for this struct
2018-08-08 12:28:26 +00:00
...
LL | S::b(&S);
2019-03-10 23:20:15 +00:00
| ^ function or associated item not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is in scope
2019-09-29 23:58:05 +00:00
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
2018-08-08 12:28:26 +00:00
|
2023-03-18 02:18:39 +00:00
LL + use method::B;
2018-08-08 12:28:26 +00:00
|
2023-02-21 21:11:08 +00:00
error[E0624]: method `a` is private
2021-03-07 15:47:39 +00:00
--> $DIR/item-privacy.rs:84:14
2018-08-08 12:28:26 +00:00
|
2021-07-17 18:13:50 +00:00
LL | fn a(&self) { }
2023-02-21 21:11:08 +00:00
| ----------- private method defined here
2021-07-17 18:13:50 +00:00
...
2021-03-07 15:47:39 +00:00
LL | <dyn C>::a(&S);
2023-02-21 21:11:08 +00:00
| ^ private method
2018-08-08 12:28:26 +00:00
2020-01-08 16:05:31 +00:00
error[E0599]: no associated item named `A` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:97:8
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- associated item `A` not found for this struct
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | S::A;
2019-03-10 23:20:15 +00:00
| ^ associated item not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is implemented and in scope
2020-02-25 02:55:51 +00:00
note: `assoc_const::A` defines an item `A`, perhaps you need to implement it
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:24:5
2020-02-25 02:55:51 +00:00
|
LL | trait A {
| ^^^^^^^
2018-08-08 12:28:26 +00:00
2020-01-08 16:05:31 +00:00
error[E0599]: no associated item named `B` found for struct `S` in the current scope
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:98:8
2018-08-08 12:28:26 +00:00
|
LL | struct S;
2022-07-01 23:47:26 +00:00
| -------- associated item `B` not found for this struct
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | S::B;
2019-03-10 23:20:15 +00:00
| ^ associated item not found in `S`
2018-08-08 12:28:26 +00:00
|
= help: items from traits can only be used if the trait is in scope
2019-09-29 23:58:05 +00:00
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
2018-08-08 12:28:26 +00:00
|
2023-03-18 02:18:39 +00:00
LL + use assoc_const::B;
2018-08-08 12:28:26 +00:00
|
error[E0624]: associated constant `A` is private
2021-03-07 15:47:39 +00:00
--> $DIR/item-privacy.rs:101:14
2018-08-08 12:28:26 +00:00
|
2021-07-17 18:13:50 +00:00
LL | const A: u8 = 0;
2022-02-13 15:27:59 +00:00
| ----------- private associated constant defined here
2021-07-17 18:13:50 +00:00
...
2021-03-07 15:47:39 +00:00
LL | <dyn C>::A;
| ^ private associated constant
2018-08-08 12:28:26 +00:00
error[E0038]: the trait `assoc_const::C` cannot be made into an object
2021-03-07 15:47:39 +00:00
--> $DIR/item-privacy.rs:101:6
2018-08-08 12:28:26 +00:00
|
2021-03-07 15:47:39 +00:00
LL | <dyn C>::A;
| ^^^^^ `assoc_const::C` cannot be made into an object
2020-10-16 00:23:45 +00:00
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:25:15
2020-10-16 00:23:45 +00:00
|
2019-09-03 03:22:22 +00:00
LL | const A: u8 = 0;
2020-10-16 00:23:45 +00:00
| ^ ...because it contains this associated `const`
2019-09-03 03:22:22 +00:00
...
LL | const B: u8 = 0;
2020-10-16 00:23:45 +00:00
| ^ ...because it contains this associated `const`
2019-09-03 03:22:22 +00:00
...
2020-02-01 00:47:00 +00:00
LL | pub trait C: A + B {
| - this trait cannot be made into an object...
2019-09-03 03:22:22 +00:00
LL | const C: u8 = 0;
2020-10-16 00:23:45 +00:00
| ^ ...because it contains this associated `const`
2021-09-12 18:49:56 +00:00
= help: consider moving `C` to another trait
= help: consider moving `A` to another trait
= help: consider moving `B` to another trait
2018-08-08 12:28:26 +00:00
error[E0223]: ambiguous associated type
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:115:12
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let _: S::A;
2023-01-08 06:54:52 +00:00
| ^^^^
|
help: if there were a trait named `Example` with associated type `A` implemented for `S`, you could use the fully-qualified path
|
LL | let _: <S as Example>::A;
| ~~~~~~~~~~~~~~~~~
2018-08-08 12:28:26 +00:00
error[E0223]: ambiguous associated type
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:116:12
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let _: S::B;
2023-01-08 06:54:52 +00:00
| ^^^^ help: use the fully-qualified path: `<S as assoc_ty::B>::B`
2018-08-08 12:28:26 +00:00
error[E0223]: ambiguous associated type
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:117:12
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let _: S::C;
2023-01-08 06:54:52 +00:00
| ^^^^ help: use the fully-qualified path: `<S as assoc_ty::C>::C`
2018-08-08 12:28:26 +00:00
2022-11-13 04:12:44 +00:00
error[E0624]: associated type `A` is private
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:119:12
2018-08-08 12:28:26 +00:00
|
2022-11-13 04:12:44 +00:00
LL | type A = u8;
| ------ associated type defined here
...
2019-03-09 12:03:44 +00:00
LL | let _: T::A;
2020-03-22 22:36:54 +00:00
| ^^^^ private associated type
2018-08-08 12:28:26 +00:00
error: associated type `A` is private
2021-02-08 22:15:45 +00:00
--> $DIR/item-privacy.rs:128:9
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | A = u8,
2020-03-22 22:36:54 +00:00
| ^^^^^^ private associated type
2018-08-08 12:28:26 +00:00
2018-09-20 07:21:29 +00:00
error: aborting due to 15 previous errors
2018-08-08 12:28:26 +00:00
2019-04-17 17:26:38 +00:00
Some errors have detailed explanations: E0038, E0223, E0599, E0624.
2018-08-08 12:28:26 +00:00
For more information about an error, try `rustc --explain E0038`.