2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no method named `a` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:67:7
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- method `a` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | S.a();
|
2024-02-10 03:33:20 +00:00
|
|
|
| ^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is implemented and in scope
|
2024-06-01 17:43:48 +08:00
|
|
|
= help: trait `method::A` which provides `a` is implemented but not reachable
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `b` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - S.a();
|
|
|
|
|
LL + S.b();
|
|
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no method named `b` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:68:7
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- method `b` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
2021-04-23 18:24:02 -07:00
|
|
|
LL | fn b(&self) { }
|
|
|
|
|
| - the method is available for `S` here
|
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | S.b();
|
2024-02-10 03:33:20 +00:00
|
|
|
| ^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `B` which provides `b` is implemented but not in scope; perhaps you want to import it
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use method::B;
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is a method `c` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - S.b();
|
|
|
|
|
LL + S.c();
|
|
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2023-02-21 14:11:08 -07:00
|
|
|
error[E0624]: method `a` is private
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:72:7
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2021-07-17 11:13:50 -07:00
|
|
|
LL | fn a(&self) { }
|
2023-02-21 14:11:08 -07:00
|
|
|
| ----------- private method defined here
|
2021-07-17 11:13:50 -07:00
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | c.a();
|
2023-02-21 14:11:08 -07:00
|
|
|
| ^ private method
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no function or associated item named `a` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:78:8
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- function or associated item `a` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
|
|
|
|
LL | S::a(&S);
|
2019-03-10 16:20:15 -07:00
|
|
|
| ^ function or associated item not found in `S`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is implemented and in scope
|
2024-06-01 17:43:48 +08:00
|
|
|
= help: trait `method::A` which provides `a` is implemented but not reachable
|
2024-02-13 22:28:46 +00:00
|
|
|
help: there is an associated constant `B` with a similar name
|
|
|
|
|
--> $DIR/item-privacy.rs:29:9
|
|
|
|
|
|
|
|
|
|
|
LL | const B: u8 = 0;
|
|
|
|
|
| ^^^^^^^^^^^
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:80:8
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- function or associated item `b` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
|
|
|
|
LL | S::b(&S);
|
2019-03-10 16:20:15 -07:00
|
|
|
| ^ function or associated item not found in `S`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-02-13 22:28:46 +00: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 23:05:23 +00:00
|
|
|
help: trait `B` which provides `b` is implemented but not in scope; perhaps you want to import it
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use method::B;
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
|
2023-02-21 14:11:08 -07:00
|
|
|
error[E0624]: method `a` is private
|
2021-03-07 18:47:39 +03:00
|
|
|
--> $DIR/item-privacy.rs:84:14
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2021-07-17 11:13:50 -07:00
|
|
|
LL | fn a(&self) { }
|
2023-02-21 14:11:08 -07:00
|
|
|
| ----------- private method defined here
|
2021-07-17 11:13:50 -07:00
|
|
|
...
|
2021-03-07 18:47:39 +03:00
|
|
|
LL | <dyn C>::a(&S);
|
2023-02-21 14:11:08 -07:00
|
|
|
| ^ private method
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no associated item named `A` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:97:8
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- associated item `A` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | S::A;
|
2019-03-10 16:20:15 -07:00
|
|
|
| ^ associated item not found in `S`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is implemented and in scope
|
2024-06-01 17:43:48 +08:00
|
|
|
= help: trait `assoc_const::A` which provides `A` is implemented but not reachable
|
2024-02-14 18:23:01 +00:00
|
|
|
help: there is an associated constant `B` with a similar name
|
2024-02-10 03:33:20 +00:00
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - S::A;
|
|
|
|
|
LL + S::B;
|
|
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2020-01-08 08:05:31 -08:00
|
|
|
error[E0599]: no associated item named `B` found for struct `S` in the current scope
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:98:8
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
LL | struct S;
|
2022-07-01 16:47:26 -07:00
|
|
|
| -------- associated item `B` not found for this struct
|
2018-08-08 14:28:26 +02:00
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | S::B;
|
2019-03-10 16:20:15 -07:00
|
|
|
| ^ associated item not found in `S`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is in scope
|
2024-06-02 21:19:11 -04:00
|
|
|
help: there is a method `b` with a similar name
|
|
|
|
|
--> $DIR/item-privacy.rs:11:9
|
|
|
|
|
|
|
|
|
|
|
LL | fn b(&self) { }
|
|
|
|
|
| ^^^^^^^^^^^
|
2024-02-13 23:05:23 +00:00
|
|
|
help: trait `B` which provides `B` is implemented but not in scope; perhaps you want to import it
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2023-03-18 02:18:39 +00:00
|
|
|
LL + use assoc_const::B;
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
|
|
2025-02-12 15:52:15 +01:00
|
|
|
error[E0038]: the trait `assoc_const::C` is not dyn compatible
|
|
|
|
|
--> $DIR/item-privacy.rs:101:6
|
|
|
|
|
|
|
|
|
|
|
LL | <dyn C>::A;
|
|
|
|
|
| ^^^^^ `assoc_const::C` is not dyn compatible
|
|
|
|
|
|
|
|
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
|
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
|
|
|
|
--> $DIR/item-privacy.rs:25:15
|
|
|
|
|
|
|
|
|
|
|
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 is not dyn compatible...
|
|
|
|
|
LL | const C: u8 = 0;
|
|
|
|
|
| ^ ...because it contains this associated `const`
|
|
|
|
|
= help: consider moving `C` to another trait
|
|
|
|
|
= help: consider moving `A` to another trait
|
|
|
|
|
= help: consider moving `B` to another trait
|
|
|
|
|
= help: only type `S` implements `assoc_const::C`; consider using it directly instead.
|
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
error[E0624]: associated constant `A` is private
|
2021-03-07 18:47:39 +03:00
|
|
|
--> $DIR/item-privacy.rs:101:14
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2021-07-17 11:13:50 -07:00
|
|
|
LL | const A: u8 = 0;
|
2022-02-13 16:27:59 +01:00
|
|
|
| ----------- private associated constant defined here
|
2021-07-17 11:13:50 -07:00
|
|
|
...
|
2021-03-07 18:47:39 +03:00
|
|
|
LL | <dyn C>::A;
|
|
|
|
|
| ^ private associated constant
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `assoc_const::C` is not dyn compatible
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:101:5
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2021-03-07 18:47:39 +03:00
|
|
|
LL | <dyn C>::A;
|
2025-02-12 15:52:15 +01:00
|
|
|
| ^^^^^^^^^^ `assoc_const::C` is not dyn compatible
|
|
|
|
|
|
|
|
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
|
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
|
|
|
|
--> $DIR/item-privacy.rs:25:15
|
|
|
|
|
|
|
|
|
|
|
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 is not dyn compatible...
|
|
|
|
|
LL | const C: u8 = 0;
|
|
|
|
|
| ^ ...because it contains this associated `const`
|
|
|
|
|
= help: consider moving `C` to another trait
|
|
|
|
|
= help: consider moving `A` to another trait
|
|
|
|
|
= help: consider moving `B` to another trait
|
|
|
|
|
= help: only type `S` implements `assoc_const::C`; consider using it directly instead.
|
|
|
|
|
|
|
|
|
|
error[E0038]: the trait `assoc_const::C` is not dyn compatible
|
|
|
|
|
--> $DIR/item-privacy.rs:105:5
|
|
|
|
|
|
|
|
|
|
|
LL | <dyn C>::B;
|
|
|
|
|
| ^^^^^^^^^^ `assoc_const::C` is not dyn compatible
|
2020-10-15 17:23:45 -07:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2021-02-08 23:15:45 +01:00
|
|
|
--> $DIR/item-privacy.rs:25:15
|
2020-10-15 17:23:45 -07:00
|
|
|
|
|
2019-09-02 20:22:22 -07:00
|
|
|
LL | const A: u8 = 0;
|
2020-10-15 17:23:45 -07:00
|
|
|
| ^ ...because it contains this associated `const`
|
2019-09-02 20:22:22 -07:00
|
|
|
...
|
|
|
|
|
LL | const B: u8 = 0;
|
2020-10-15 17:23:45 -07:00
|
|
|
| ^ ...because it contains this associated `const`
|
2019-09-02 20:22:22 -07:00
|
|
|
...
|
2020-01-31 16:47:00 -08:00
|
|
|
LL | pub trait C: A + B {
|
2024-11-20 14:19:36 -08:00
|
|
|
| - this trait is not dyn compatible...
|
2019-09-02 20:22:22 -07:00
|
|
|
LL | const C: u8 = 0;
|
2020-10-15 17:23:45 -07: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
|
2024-11-20 14:19:36 -08:00
|
|
|
= help: only type `S` implements `assoc_const::C`; consider using it directly instead.
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
error[E0223]: ambiguous associated type
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:118:12
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-03-09 15:03:44 +03: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
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - let _: S::A;
|
|
|
|
|
LL + let _: <S as Example>::A;
|
|
|
|
|
|
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
error[E0223]: ambiguous associated type
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:119:12
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let _: S::B;
|
2023-10-16 18:25:11 +00:00
|
|
|
| ^^^^ help: use fully-qualified syntax: `<S as assoc_ty::B>::B`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
|
|
|
error[E0223]: ambiguous associated type
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:120:12
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let _: S::C;
|
2023-10-16 18:25:11 +00:00
|
|
|
| ^^^^ help: use fully-qualified syntax: `<S as assoc_ty::C>::C`
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2022-11-13 05:12:44 +01:00
|
|
|
error[E0624]: associated type `A` is private
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:122:12
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2022-11-13 05:12:44 +01:00
|
|
|
LL | type A = u8;
|
2024-06-04 16:47:23 +02:00
|
|
|
| ------ the associated type is defined here
|
2022-11-13 05:12:44 +01:00
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | let _: T::A;
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^^^^ private associated type
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2024-06-04 16:47:23 +02:00
|
|
|
error[E0624]: associated type `A` is private
|
2025-02-12 15:52:15 +01:00
|
|
|
--> $DIR/item-privacy.rs:131:9
|
2018-08-08 14:28:26 +02:00
|
|
|
|
|
2024-06-04 16:47:23 +02:00
|
|
|
LL | type A = u8;
|
|
|
|
|
| ------ the associated type is defined here
|
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | A = u8,
|
2020-03-22 15:36:54 -07:00
|
|
|
| ^^^^^^ private associated type
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2025-02-12 15:52:15 +01:00
|
|
|
error: aborting due to 17 previous errors
|
2018-08-08 14:28:26 +02:00
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0038, E0223, E0599, E0624.
|
2018-08-08 14:28:26 +02:00
|
|
|
For more information about an error, try `rustc --explain E0038`.
|