summaryrefslogtreecommitdiffstats
path: root/tests/ui/did_you_mean/bad-assoc-ty.stderr
blob: 55096e95df7e06cee280a39f5f477cf81a108c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:1:10
   |
LL | type A = [u8; 4]::AssocTy;
   |          ^^^^^^^^^^^^^^^^ help: try: `<[u8; 4]>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:5:10
   |
LL | type B = [u8]::AssocTy;
   |          ^^^^^^^^^^^^^ help: try: `<[u8]>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:9:10
   |
LL | type C = (u8)::AssocTy;
   |          ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:13:10
   |
LL | type D = (u8, u8)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:17:10
   |
LL | type E = _::AssocTy;
   |          ^^^^^^^^^^ help: try: `<_>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:21:19
   |
LL | type F = &'static (u8)::AssocTy;
   |                   ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:27:10
   |
LL | type G = dyn 'static + (Send)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<dyn 'static + (Send)>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:46:10
   |
LL | type I = ty!()::AssocTy;
   |          ^^^^^^^^^^^^^^ help: try: `<ty!()>::AssocTy`

error: missing angle brackets in associated item path
  --> $DIR/bad-assoc-ty.rs:39:19
   |
LL |     ($ty: ty) => ($ty::AssocTy);
   |                   ^^^^^^^^^^^^ help: try: `<$ty>::AssocTy`
...
LL | type J = ty!(u8);
   |          ------- in this macro invocation
   |
   = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:1:10
   |
LL | type A = [u8; 4]::AssocTy;
   |          ^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8; 4]`, you could use the fully-qualified path
   |
LL | type A = <[u8; 4] as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:5:10
   |
LL | type B = [u8]::AssocTy;
   |          ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `[u8]`, you could use the fully-qualified path
   |
LL | type B = <[u8] as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:9:10
   |
LL | type C = (u8)::AssocTy;
   |          ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL | type C = <u8 as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:13:10
   |
LL | type D = (u8, u8)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(u8, u8)`, you could use the fully-qualified path
   |
LL | type D = <(u8, u8) as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
  --> $DIR/bad-assoc-ty.rs:17:10
   |
LL | type E = _::AssocTy;
   |          ^ not allowed in type signatures

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:21:19
   |
LL | type F = &'static (u8)::AssocTy;
   |                   ^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL | type F = &'static <u8 as Example>::AssocTy;
   |                   ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:27:10
   |
LL | type G = dyn 'static + (Send)::AssocTy;
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path
   |
LL | type G = <(dyn Send + 'static) as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

warning: trait objects without an explicit `dyn` are deprecated
  --> $DIR/bad-assoc-ty.rs:33:10
   |
LL | type H = Fn(u8) -> (u8)::Output;
   |          ^^^^^^^^^^^^^^
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
   = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
   |
LL | type H = <dyn Fn(u8) -> (u8)>::Output;
   |          ++++               +

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:33:10
   |
LL | type H = Fn(u8) -> (u8)::Output;
   |          ^^^^^^^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output`

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:39:19
   |
LL |     ($ty: ty) => ($ty::AssocTy);
   |                   ^^^^^^^^^^^^
...
LL | type J = ty!(u8);
   |          ------- in this macro invocation
   |
   = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL |     ($ty: ty) => (<u8 as Example>::AssocTy);
   |                   ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> $DIR/bad-assoc-ty.rs:46:10
   |
LL | type I = ty!()::AssocTy;
   |          ^^^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `AssocTy` implemented for `u8`, you could use the fully-qualified path
   |
LL | type I = <u8 as Example>::AssocTy;
   |          ~~~~~~~~~~~~~~~~~~~~~~~~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
  --> $DIR/bad-assoc-ty.rs:51:13
   |
LL | fn foo<X: K<_, _>>(x: X) {}
   |             ^  ^ not allowed in type signatures
   |             |
   |             not allowed in type signatures
   |
help: use type parameters instead
   |
LL | fn foo<X: K<T, T>, T>(x: X) {}
   |             ~  ~ +++

error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
  --> $DIR/bad-assoc-ty.rs:54:34
   |
LL | fn bar<F>(_: F) where F: Fn() -> _ {}
   |                                  ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
   |         +++                         ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
  --> $DIR/bad-assoc-ty.rs:57:19
   |
LL | fn baz<F: Fn() -> _>(_: F) {}
   |                   ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | fn baz<F: Fn() -> T, T>(_: F) {}
   |                   ~+++

error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
  --> $DIR/bad-assoc-ty.rs:60:33
   |
LL | struct L<F>(F) where F: Fn() -> _;
   |                                 ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | struct L<F, T>(F) where F: Fn() -> T;
   |           +++                      ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
  --> $DIR/bad-assoc-ty.rs:62:30
   |
LL | struct M<F> where F: Fn() -> _ {
   |                              ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | struct M<F, T> where F: Fn() -> T {
   |           +++                   ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for enums
  --> $DIR/bad-assoc-ty.rs:66:28
   |
LL | enum N<F> where F: Fn() -> _ {
   |                            ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | enum N<F, T> where F: Fn() -> T {
   |         +++                   ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for unions
  --> $DIR/bad-assoc-ty.rs:71:29
   |
LL | union O<F> where F: Fn() -> _ {
   |                             ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | union O<F, T> where F: Fn() -> T {
   |          +++                   ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for traits
  --> $DIR/bad-assoc-ty.rs:76:29
   |
LL | trait P<F> where F: Fn() -> _ {
   |                             ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL | trait P<F, T> where F: Fn() -> T {
   |          +++                   ~

error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
  --> $DIR/bad-assoc-ty.rs:81:38
   |
LL |     fn foo<F>(_: F) where F: Fn() -> _ {}
   |                                      ^ not allowed in type signatures
   |
help: use type parameters instead
   |
LL |     fn foo<F, T>(_: F) where F: Fn() -> T {}
   |             +++                         ~

error: aborting due to 28 previous errors; 1 warning emitted

Some errors have detailed explanations: E0121, E0223.
For more information about an error, try `rustc --explain E0121`.