]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/bad-assoc-ty.stderr
Account for method call and indexing when looking for inner-most path in expression
[rust.git] / tests / ui / did_you_mean / bad-assoc-ty.stderr
1 error: missing angle brackets in associated item path
2   --> $DIR/bad-assoc-ty.rs:1:10
3    |
4 LL | type A = [u8; 4]::AssocTy;
5    |          ^^^^^^^^^^^^^^^^ help: try: `<[u8; 4]>::AssocTy`
6
7 error: missing angle brackets in associated item path
8   --> $DIR/bad-assoc-ty.rs:5:10
9    |
10 LL | type B = [u8]::AssocTy;
11    |          ^^^^^^^^^^^^^ help: try: `<[u8]>::AssocTy`
12
13 error: missing angle brackets in associated item path
14   --> $DIR/bad-assoc-ty.rs:9:10
15    |
16 LL | type C = (u8)::AssocTy;
17    |          ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
18
19 error: missing angle brackets in associated item path
20   --> $DIR/bad-assoc-ty.rs:13:10
21    |
22 LL | type D = (u8, u8)::AssocTy;
23    |          ^^^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::AssocTy`
24
25 error: missing angle brackets in associated item path
26   --> $DIR/bad-assoc-ty.rs:17:10
27    |
28 LL | type E = _::AssocTy;
29    |          ^^^^^^^^^^ help: try: `<_>::AssocTy`
30
31 error: missing angle brackets in associated item path
32   --> $DIR/bad-assoc-ty.rs:21:19
33    |
34 LL | type F = &'static (u8)::AssocTy;
35    |                   ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
36
37 error: missing angle brackets in associated item path
38   --> $DIR/bad-assoc-ty.rs:27:10
39    |
40 LL | type G = dyn 'static + (Send)::AssocTy;
41    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<dyn 'static + (Send)>::AssocTy`
42
43 error: missing angle brackets in associated item path
44   --> $DIR/bad-assoc-ty.rs:46:10
45    |
46 LL | type I = ty!()::AssocTy;
47    |          ^^^^^^^^^^^^^^ help: try: `<ty!()>::AssocTy`
48
49 error: missing angle brackets in associated item path
50   --> $DIR/bad-assoc-ty.rs:39:19
51    |
52 LL |     ($ty: ty) => ($ty::AssocTy);
53    |                   ^^^^^^^^^^^^ help: try: `<$ty>::AssocTy`
54 ...
55 LL | type J = ty!(u8);
56    |          ------- in this macro invocation
57    |
58    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
59
60 error[E0223]: ambiguous associated type
61   --> $DIR/bad-assoc-ty.rs:1:10
62    |
63 LL | type A = [u8; 4]::AssocTy;
64    |          ^^^^^^^^^^^^^^^^
65    |
66 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8; 4]`, you could use the fully-qualified path
67    |
68 LL | type A = <[u8; 4] as Example>::AssocTy;
69    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70
71 error[E0223]: ambiguous associated type
72   --> $DIR/bad-assoc-ty.rs:5:10
73    |
74 LL | type B = [u8]::AssocTy;
75    |          ^^^^^^^^^^^^^
76    |
77 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8]`, you could use the fully-qualified path
78    |
79 LL | type B = <[u8] as Example>::AssocTy;
80    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~
81
82 error[E0223]: ambiguous associated type
83   --> $DIR/bad-assoc-ty.rs:9:10
84    |
85 LL | type C = (u8)::AssocTy;
86    |          ^^^^^^^^^^^^^
87    |
88 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
89    |
90 LL | type C = <u8 as Example>::AssocTy;
91    |          ~~~~~~~~~~~~~~~~~~~~~~~~
92
93 error[E0223]: ambiguous associated type
94   --> $DIR/bad-assoc-ty.rs:13:10
95    |
96 LL | type D = (u8, u8)::AssocTy;
97    |          ^^^^^^^^^^^^^^^^^
98    |
99 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(u8, u8)`, you could use the fully-qualified path
100    |
101 LL | type D = <(u8, u8) as Example>::AssocTy;
102    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103
104 error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
105   --> $DIR/bad-assoc-ty.rs:17:10
106    |
107 LL | type E = _::AssocTy;
108    |          ^ not allowed in type signatures
109
110 error[E0223]: ambiguous associated type
111   --> $DIR/bad-assoc-ty.rs:21:19
112    |
113 LL | type F = &'static (u8)::AssocTy;
114    |                   ^^^^^^^^^^^^^
115    |
116 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
117    |
118 LL | type F = &'static <u8 as Example>::AssocTy;
119    |                   ~~~~~~~~~~~~~~~~~~~~~~~~
120
121 error[E0223]: ambiguous associated type
122   --> $DIR/bad-assoc-ty.rs:27:10
123    |
124 LL | type G = dyn 'static + (Send)::AssocTy;
125    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126    |
127 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path
128    |
129 LL | type G = <(dyn Send + 'static) as Example>::AssocTy;
130    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131
132 warning: trait objects without an explicit `dyn` are deprecated
133   --> $DIR/bad-assoc-ty.rs:33:10
134    |
135 LL | type H = Fn(u8) -> (u8)::Output;
136    |          ^^^^^^^^^^^^^^
137    |
138    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
139    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
140    = note: `#[warn(bare_trait_objects)]` on by default
141 help: use `dyn`
142    |
143 LL | type H = <dyn Fn(u8) -> (u8)>::Output;
144    |          ++++               +
145
146 error[E0223]: ambiguous associated type
147   --> $DIR/bad-assoc-ty.rs:33:10
148    |
149 LL | type H = Fn(u8) -> (u8)::Output;
150    |          ^^^^^^^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output`
151
152 error[E0223]: ambiguous associated type
153   --> $DIR/bad-assoc-ty.rs:39:19
154    |
155 LL |     ($ty: ty) => ($ty::AssocTy);
156    |                   ^^^^^^^^^^^^
157 ...
158 LL | type J = ty!(u8);
159    |          ------- in this macro invocation
160    |
161    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
162 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
163    |
164 LL |     ($ty: ty) => (<u8 as Example>::AssocTy);
165    |                   ~~~~~~~~~~~~~~~~~~~~~~~~
166
167 error[E0223]: ambiguous associated type
168   --> $DIR/bad-assoc-ty.rs:46:10
169    |
170 LL | type I = ty!()::AssocTy;
171    |          ^^^^^^^^^^^^^^
172    |
173 help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
174    |
175 LL | type I = <u8 as Example>::AssocTy;
176    |          ~~~~~~~~~~~~~~~~~~~~~~~~
177
178 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
179   --> $DIR/bad-assoc-ty.rs:51:13
180    |
181 LL | fn foo<X: K<_, _>>(x: X) {}
182    |             ^  ^ not allowed in type signatures
183    |             |
184    |             not allowed in type signatures
185    |
186 help: use type parameters instead
187    |
188 LL | fn foo<X: K<T, T>, T>(x: X) {}
189    |             ~  ~ +++
190
191 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
192   --> $DIR/bad-assoc-ty.rs:54:34
193    |
194 LL | fn bar<F>(_: F) where F: Fn() -> _ {}
195    |                                  ^ not allowed in type signatures
196    |
197 help: use type parameters instead
198    |
199 LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
200    |         +++                         ~
201
202 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
203   --> $DIR/bad-assoc-ty.rs:57:19
204    |
205 LL | fn baz<F: Fn() -> _>(_: F) {}
206    |                   ^ not allowed in type signatures
207    |
208 help: use type parameters instead
209    |
210 LL | fn baz<F: Fn() -> T, T>(_: F) {}
211    |                   ~+++
212
213 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
214   --> $DIR/bad-assoc-ty.rs:60:33
215    |
216 LL | struct L<F>(F) where F: Fn() -> _;
217    |                                 ^ not allowed in type signatures
218    |
219 help: use type parameters instead
220    |
221 LL | struct L<F, T>(F) where F: Fn() -> T;
222    |           +++                      ~
223
224 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
225   --> $DIR/bad-assoc-ty.rs:62:30
226    |
227 LL | struct M<F> where F: Fn() -> _ {
228    |                              ^ not allowed in type signatures
229    |
230 help: use type parameters instead
231    |
232 LL | struct M<F, T> where F: Fn() -> T {
233    |           +++                   ~
234
235 error[E0121]: the placeholder `_` is not allowed within types on item signatures for enums
236   --> $DIR/bad-assoc-ty.rs:66:28
237    |
238 LL | enum N<F> where F: Fn() -> _ {
239    |                            ^ not allowed in type signatures
240    |
241 help: use type parameters instead
242    |
243 LL | enum N<F, T> where F: Fn() -> T {
244    |         +++                   ~
245
246 error[E0121]: the placeholder `_` is not allowed within types on item signatures for unions
247   --> $DIR/bad-assoc-ty.rs:71:29
248    |
249 LL | union O<F> where F: Fn() -> _ {
250    |                             ^ not allowed in type signatures
251    |
252 help: use type parameters instead
253    |
254 LL | union O<F, T> where F: Fn() -> T {
255    |          +++                   ~
256
257 error[E0121]: the placeholder `_` is not allowed within types on item signatures for traits
258   --> $DIR/bad-assoc-ty.rs:76:29
259    |
260 LL | trait P<F> where F: Fn() -> _ {
261    |                             ^ not allowed in type signatures
262    |
263 help: use type parameters instead
264    |
265 LL | trait P<F, T> where F: Fn() -> T {
266    |          +++                   ~
267
268 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
269   --> $DIR/bad-assoc-ty.rs:81:38
270    |
271 LL |     fn foo<F>(_: F) where F: Fn() -> _ {}
272    |                                      ^ not allowed in type signatures
273    |
274 help: use type parameters instead
275    |
276 LL |     fn foo<F, T>(_: F) where F: Fn() -> T {}
277    |             +++                         ~
278
279 error: aborting due to 28 previous errors; 1 warning emitted
280
281 Some errors have detailed explanations: E0121, E0223.
282 For more information about an error, try `rustc --explain E0121`.