2020-01-08 10:05:31 -06:00
error[E0599]: no method named `a` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:67:7
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- method `a` not found for this struct
2018-08-08 07:28:26 -05:00
...
2019-03-09 06:03:44 -06:00
LL | S.a();
2024-02-09 21:33:20 -06:00
| ^
2018-08-08 07:28:26 -05:00
|
= help: items from traits can only be used if the trait is implemented and in scope
2024-02-13 17:05:23 -06:00
help: trait `A` which provides `a` is implemented but not in scope; perhaps you want to import it
2023-10-17 17:06:58 -05:00
|
LL + use method::A;
2020-02-24 20:55:51 -06:00
|
2024-02-14 12:23:01 -06:00
help: there is a method `b` with a similar name
2024-02-09 21:33:20 -06:00
|
LL | S.b();
| ~
2018-08-08 07:28:26 -05:00
2020-01-08 10:05:31 -06:00
error[E0599]: no method named `b` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:68:7
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- method `b` not found for this struct
2018-08-08 07:28:26 -05:00
...
2021-04-23 20:24:02 -05:00
LL | fn b(&self) { }
| - the method is available for `S` here
...
2019-03-09 06:03:44 -06:00
LL | S.b();
2024-02-09 21:33:20 -06:00
| ^
2018-08-08 07:28:26 -05:00
|
= help: items from traits can only be used if the trait is in scope
2024-02-13 17:05:23 -06:00
help: trait `B` which provides `b` is implemented but not in scope; perhaps you want to import it
2018-08-08 07:28:26 -05:00
|
2023-03-17 21:18:39 -05:00
LL + use method::B;
2018-08-08 07:28:26 -05:00
|
2024-02-14 12:23:01 -06:00
help: there is a method `c` with a similar name
2024-02-09 21:33:20 -06:00
|
LL | S.c();
| ~
2018-08-08 07:28:26 -05:00
2023-02-21 15:11:08 -06:00
error[E0624]: method `a` is private
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:72:7
2018-08-08 07:28:26 -05:00
|
2021-07-17 13:13:50 -05:00
LL | fn a(&self) { }
2023-02-21 15:11:08 -06:00
| ----------- private method defined here
2021-07-17 13:13:50 -05:00
...
2019-03-09 06:03:44 -06:00
LL | c.a();
2023-02-21 15:11:08 -06:00
| ^ private method
2018-08-08 07:28:26 -05:00
2020-01-08 10:05:31 -06:00
error[E0599]: no function or associated item named `a` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:78:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- function or associated item `a` not found for this struct
2018-08-08 07:28:26 -05:00
...
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
2024-02-13 16:28:46 -06:00
help: there is an associated constant `B` with a similar name
--> $DIR/item-privacy.rs:29:9
|
LL | const B: u8 = 0;
| ^^^^^^^^^^^
2024-02-13 17:05:23 -06:00
help: trait `A` which provides `a` is implemented but not in scope; perhaps you want to import it
2023-10-17 17:06:58 -05:00
|
LL + use method::A;
2020-02-24 20:55:51 -06:00
|
2018-08-08 07:28:26 -05:00
2020-01-08 10:05:31 -06:00
error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:80:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- function or associated item `b` not found for this struct
2018-08-08 07:28:26 -05:00
...
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
2024-02-13 16:28:46 -06:00
help: there is an associated constant `B` with a similar name
--> $DIR/item-privacy.rs:29:9
|
LL | const B: u8 = 0;
| ^^^^^^^^^^^
2024-02-13 17:05:23 -06:00
help: trait `B` which provides `b` is implemented but not in scope; perhaps you want to import it
2018-08-08 07:28:26 -05:00
|
2023-03-17 21:18:39 -05:00
LL + use method::B;
2018-08-08 07:28:26 -05:00
|
2023-02-21 15:11:08 -06:00
error[E0624]: method `a` is private
2021-03-07 09:47:39 -06:00
--> $DIR/item-privacy.rs:84:14
2018-08-08 07:28:26 -05:00
|
2021-07-17 13:13:50 -05:00
LL | fn a(&self) { }
2023-02-21 15:11:08 -06:00
| ----------- private method defined here
2021-07-17 13:13:50 -05:00
...
2021-03-07 09:47:39 -06:00
LL | <dyn C>::a(&S);
2023-02-21 15:11:08 -06:00
| ^ private method
2018-08-08 07:28:26 -05:00
2020-01-08 10:05:31 -06:00
error[E0599]: no associated item named `A` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:97:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- associated item `A` not found for this struct
2018-08-08 07:28:26 -05:00
...
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
2024-02-13 17:05:23 -06:00
help: trait `A` which provides `A` is implemented but not in scope; perhaps you want to import it
2023-10-17 17:06:58 -05:00
|
LL + use assoc_const::A;
2020-02-24 20:55:51 -06:00
|
2024-02-14 12:23:01 -06:00
help: there is an associated constant `B` with a similar name
2024-02-09 21:33:20 -06:00
|
LL | S::B;
| ~
2018-08-08 07:28:26 -05:00
2020-01-08 10:05:31 -06:00
error[E0599]: no associated item named `B` found for struct `S` in the current scope
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:98:8
2018-08-08 07:28:26 -05:00
|
LL | struct S;
2022-07-01 18:47:26 -05:00
| -------- associated item `B` not found for this struct
2018-08-08 07:28:26 -05:00
...
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
2024-02-13 17:05:23 -06:00
help: trait `B` which provides `B` is implemented but not in scope; perhaps you want to import it
2018-08-08 07:28:26 -05:00
|
2023-03-17 21:18:39 -05:00
LL + use assoc_const::B;
2018-08-08 07:28:26 -05:00
|
2024-02-14 12:23:01 -06:00
help: there is a method `b` with a similar name
2024-02-09 21:33:20 -06:00
|
LL | S::b;
| ~
2018-08-08 07:28:26 -05:00
error[E0624]: associated constant `A` is private
2021-03-07 09:47:39 -06:00
--> $DIR/item-privacy.rs:101:14
2018-08-08 07:28:26 -05:00
|
2021-07-17 13:13:50 -05:00
LL | const A: u8 = 0;
2022-02-13 09:27:59 -06:00
| ----------- private associated constant defined here
2021-07-17 13:13:50 -05:00
...
2021-03-07 09:47:39 -06:00
LL | <dyn C>::A;
| ^ private associated constant
2018-08-08 07:28:26 -05:00
error[E0038]: the trait `assoc_const::C` cannot be made into an object
2021-03-07 09:47:39 -06:00
--> $DIR/item-privacy.rs:101:6
2018-08-08 07:28:26 -05:00
|
2021-03-07 09:47:39 -06:00
LL | <dyn C>::A;
| ^^^^^ `assoc_const::C` cannot be made into an object
2020-10-15 19:23:45 -05: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 16:15:45 -06:00
--> $DIR/item-privacy.rs:25:15
2020-10-15 19:23:45 -05:00
|
2019-09-02 22:22:22 -05:00
LL | const A: u8 = 0;
2020-10-15 19:23:45 -05:00
| ^ ...because it contains this associated `const`
2019-09-02 22:22:22 -05:00
...
LL | const B: u8 = 0;
2020-10-15 19:23:45 -05:00
| ^ ...because it contains this associated `const`
2019-09-02 22:22:22 -05:00
...
2020-01-31 18:47:00 -06:00
LL | pub trait C: A + B {
| - this trait cannot be made into an object...
2019-09-02 22:22:22 -05:00
LL | const C: u8 = 0;
2020-10-15 19:23:45 -05:00
| ^ ...because it contains this associated `const`
2021-09-12 13:49:56 -05:00
= help: consider moving `C` to another trait
= help: consider moving `A` to another trait
= help: consider moving `B` to another trait
2023-10-24 11:45:04 -05:00
= help: only type `S` implements the trait, consider using it directly instead
2018-08-08 07:28:26 -05:00
error[E0223]: ambiguous associated type
2021-02-08 16:15:45 -06:00
--> $DIR/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;
2023-01-08 00:54:52 -06: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 07:28:26 -05:00
error[E0223]: ambiguous associated type
2021-02-08 16:15:45 -06:00
--> $DIR/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;
2023-10-16 13:25:11 -05:00
| ^^^^ help: use fully-qualified syntax: `<S as assoc_ty::B>::B`
2018-08-08 07:28:26 -05:00
error[E0223]: ambiguous associated type
2021-02-08 16:15:45 -06:00
--> $DIR/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;
2023-10-16 13:25:11 -05:00
| ^^^^ help: use fully-qualified syntax: `<S as assoc_ty::C>::C`
2018-08-08 07:28:26 -05:00
2022-11-12 22:12:44 -06:00
error[E0624]: associated type `A` is private
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:119:12
2018-08-08 07:28:26 -05:00
|
2022-11-12 22:12:44 -06:00
LL | type A = u8;
| ------ associated type defined here
...
2019-03-09 06:03:44 -06:00
LL | let _: T::A;
2020-03-22 17:36:54 -05:00
| ^^^^ private associated type
2018-08-08 07:28:26 -05:00
error: associated type `A` is private
2021-02-08 16:15:45 -06:00
--> $DIR/item-privacy.rs:128:9
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | A = u8,
2020-03-22 17:36:54 -05:00
| ^^^^^^ private associated type
2018-08-08 07:28:26 -05:00
2018-09-20 02:21:29 -05:00
error: aborting due to 15 previous errors
2018-08-08 07:28:26 -05:00
2019-04-17 12:26:38 -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`.