]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | error[E0599]: no method named `a` found for struct `S` in the current scope |
6a06907d | 2 | --> $DIR/item-privacy.rs:67:7 |
b7449926 XL |
3 | | |
4 | LL | struct S; | |
064997fb | 5 | | -------- method `a` not found for this struct |
b7449926 | 6 | ... |
532ac7d7 | 7 | LL | S.a(); |
e1599b0c | 8 | | ^ method not found in `S` |
b7449926 XL |
9 | | |
10 | = help: items from traits can only be used if the trait is implemented and in scope | |
74b04a01 | 11 | note: `method::A` defines an item `a`, perhaps you need to implement it |
6a06907d | 12 | --> $DIR/item-privacy.rs:6:5 |
74b04a01 XL |
13 | | |
14 | LL | trait A { | |
15 | | ^^^^^^^ | |
b7449926 | 16 | |
dfeec247 | 17 | error[E0599]: no method named `b` found for struct `S` in the current scope |
6a06907d | 18 | --> $DIR/item-privacy.rs:68:7 |
b7449926 XL |
19 | | |
20 | LL | struct S; | |
064997fb | 21 | | -------- method `b` not found for this struct |
b7449926 | 22 | ... |
cdc7bbd5 XL |
23 | LL | fn b(&self) { } |
24 | | - the method is available for `S` here | |
25 | ... | |
532ac7d7 | 26 | LL | S.b(); |
e1599b0c | 27 | | ^ method not found in `S` |
b7449926 XL |
28 | | |
29 | = help: items from traits can only be used if the trait is in scope | |
e74abb32 | 30 | help: the following trait is implemented but not in scope; perhaps add a `use` for it: |
b7449926 XL |
31 | | |
32 | LL | use method::B; | |
33 | | | |
34 | ||
ba9703b0 | 35 | error[E0624]: associated function `a` is private |
6a06907d | 36 | --> $DIR/item-privacy.rs:72:7 |
b7449926 | 37 | | |
136023e0 XL |
38 | LL | fn a(&self) { } |
39 | | ----------- private associated function defined here | |
40 | ... | |
532ac7d7 | 41 | LL | c.a(); |
ba9703b0 | 42 | | ^ private associated function |
b7449926 | 43 | |
dfeec247 | 44 | error[E0599]: no function or associated item named `a` found for struct `S` in the current scope |
6a06907d | 45 | --> $DIR/item-privacy.rs:78:8 |
b7449926 XL |
46 | | |
47 | LL | struct S; | |
064997fb | 48 | | -------- function or associated item `a` not found for this struct |
b7449926 XL |
49 | ... |
50 | LL | S::a(&S); | |
532ac7d7 | 51 | | ^ function or associated item not found in `S` |
b7449926 XL |
52 | | |
53 | = help: items from traits can only be used if the trait is implemented and in scope | |
74b04a01 | 54 | note: `method::A` defines an item `a`, perhaps you need to implement it |
6a06907d | 55 | --> $DIR/item-privacy.rs:6:5 |
74b04a01 XL |
56 | | |
57 | LL | trait A { | |
58 | | ^^^^^^^ | |
b7449926 | 59 | |
dfeec247 | 60 | error[E0599]: no function or associated item named `b` found for struct `S` in the current scope |
6a06907d | 61 | --> $DIR/item-privacy.rs:80:8 |
b7449926 XL |
62 | | |
63 | LL | struct S; | |
064997fb | 64 | | -------- function or associated item `b` not found for this struct |
b7449926 XL |
65 | ... |
66 | LL | S::b(&S); | |
532ac7d7 | 67 | | ^ function or associated item not found in `S` |
b7449926 XL |
68 | | |
69 | = help: items from traits can only be used if the trait is in scope | |
e74abb32 | 70 | help: the following trait is implemented but not in scope; perhaps add a `use` for it: |
b7449926 XL |
71 | | |
72 | LL | use method::B; | |
73 | | | |
74 | ||
ba9703b0 | 75 | error[E0624]: associated function `a` is private |
6a06907d | 76 | --> $DIR/item-privacy.rs:84:14 |
b7449926 | 77 | | |
136023e0 XL |
78 | LL | fn a(&self) { } |
79 | | ----------- private associated function defined here | |
80 | ... | |
6a06907d XL |
81 | LL | <dyn C>::a(&S); |
82 | | ^ private associated function | |
b7449926 | 83 | |
dfeec247 | 84 | error[E0599]: no associated item named `A` found for struct `S` in the current scope |
6a06907d | 85 | --> $DIR/item-privacy.rs:97:8 |
b7449926 XL |
86 | | |
87 | LL | struct S; | |
064997fb | 88 | | -------- associated item `A` not found for this struct |
b7449926 | 89 | ... |
532ac7d7 XL |
90 | LL | S::A; |
91 | | ^ associated item not found in `S` | |
b7449926 XL |
92 | | |
93 | = help: items from traits can only be used if the trait is implemented and in scope | |
74b04a01 | 94 | note: `assoc_const::A` defines an item `A`, perhaps you need to implement it |
6a06907d | 95 | --> $DIR/item-privacy.rs:24:5 |
74b04a01 XL |
96 | | |
97 | LL | trait A { | |
98 | | ^^^^^^^ | |
b7449926 | 99 | |
dfeec247 | 100 | error[E0599]: no associated item named `B` found for struct `S` in the current scope |
6a06907d | 101 | --> $DIR/item-privacy.rs:98:8 |
b7449926 XL |
102 | | |
103 | LL | struct S; | |
064997fb | 104 | | -------- associated item `B` not found for this struct |
b7449926 | 105 | ... |
532ac7d7 XL |
106 | LL | S::B; |
107 | | ^ associated item not found in `S` | |
b7449926 XL |
108 | | |
109 | = help: items from traits can only be used if the trait is in scope | |
e74abb32 | 110 | help: the following trait is implemented but not in scope; perhaps add a `use` for it: |
b7449926 XL |
111 | | |
112 | LL | use assoc_const::B; | |
113 | | | |
114 | ||
115 | error[E0624]: associated constant `A` is private | |
6a06907d | 116 | --> $DIR/item-privacy.rs:101:14 |
b7449926 | 117 | | |
136023e0 | 118 | LL | const A: u8 = 0; |
064997fb | 119 | | ----------- private associated constant defined here |
136023e0 | 120 | ... |
6a06907d XL |
121 | LL | <dyn C>::A; |
122 | | ^ private associated constant | |
b7449926 | 123 | |
b7449926 | 124 | error[E0038]: the trait `assoc_const::C` cannot be made into an object |
6a06907d | 125 | --> $DIR/item-privacy.rs:101:6 |
b7449926 | 126 | | |
6a06907d XL |
127 | LL | <dyn C>::A; |
128 | | ^^^^^ `assoc_const::C` cannot be made into an object | |
29967ef6 | 129 | | |
29967ef6 | 130 | 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> |
6a06907d | 131 | --> $DIR/item-privacy.rs:25:15 |
29967ef6 | 132 | | |
e1599b0c | 133 | LL | const A: u8 = 0; |
29967ef6 | 134 | | ^ ...because it contains this associated `const` |
e1599b0c XL |
135 | ... |
136 | LL | const B: u8 = 0; | |
29967ef6 | 137 | | ^ ...because it contains this associated `const` |
e1599b0c | 138 | ... |
74b04a01 XL |
139 | LL | pub trait C: A + B { |
140 | | - this trait cannot be made into an object... | |
e1599b0c | 141 | LL | const C: u8 = 0; |
29967ef6 | 142 | | ^ ...because it contains this associated `const` |
c295e0f8 XL |
143 | = help: consider moving `C` to another trait |
144 | = help: consider moving `A` to another trait | |
145 | = help: consider moving `B` to another trait | |
b7449926 XL |
146 | |
147 | error[E0223]: ambiguous associated type | |
6a06907d | 148 | --> $DIR/item-privacy.rs:115:12 |
b7449926 | 149 | | |
532ac7d7 | 150 | LL | let _: S::A; |
0bf4aa26 | 151 | | ^^^^ help: use fully-qualified syntax: `<S as Trait>::A` |
b7449926 XL |
152 | |
153 | error[E0223]: ambiguous associated type | |
6a06907d | 154 | --> $DIR/item-privacy.rs:116:12 |
b7449926 | 155 | | |
532ac7d7 | 156 | LL | let _: S::B; |
0bf4aa26 | 157 | | ^^^^ help: use fully-qualified syntax: `<S as Trait>::B` |
b7449926 XL |
158 | |
159 | error[E0223]: ambiguous associated type | |
6a06907d | 160 | --> $DIR/item-privacy.rs:117:12 |
b7449926 | 161 | | |
532ac7d7 | 162 | LL | let _: S::C; |
0bf4aa26 | 163 | | ^^^^ help: use fully-qualified syntax: `<S as Trait>::C` |
b7449926 XL |
164 | |
165 | error: associated type `A` is private | |
6a06907d | 166 | --> $DIR/item-privacy.rs:119:12 |
b7449926 | 167 | | |
532ac7d7 | 168 | LL | let _: T::A; |
ba9703b0 | 169 | | ^^^^ private associated type |
b7449926 XL |
170 | |
171 | error: associated type `A` is private | |
6a06907d | 172 | --> $DIR/item-privacy.rs:128:9 |
b7449926 | 173 | | |
532ac7d7 | 174 | LL | A = u8, |
ba9703b0 | 175 | | ^^^^^^ private associated type |
b7449926 | 176 | |
a1dfa0c6 | 177 | error: aborting due to 15 previous errors |
b7449926 | 178 | |
48663c56 | 179 | Some errors have detailed explanations: E0038, E0223, E0599, E0624. |
b7449926 | 180 | For more information about an error, try `rustc --explain E0038`. |