@@ -19,6 +19,11 @@ help: try surrounding the expression in parentheses
19
19
|
20
20
LL | (vec![1, 2, 3]: Vec<i32>)[0];
21
21
| + +
22
+ help: alternatively, remove the type ascription
23
+ |
24
+ LL - vec![1, 2, 3]: Vec<i32>[0];
25
+ LL + vec![1, 2, 3][0];
26
+ |
22
27
23
28
error: casts cannot be followed by indexing
24
29
--> $DIR/issue-35813-postfix-after-cast.rs:17:5
@@ -41,6 +46,11 @@ help: try surrounding the expression in parentheses
41
46
|
42
47
LL | ((&[0i32]): &[i32; 1])[0];
43
48
| + +
49
+ help: alternatively, remove the type ascription
50
+ |
51
+ LL - (&[0i32]): &[i32; 1][0];
52
+ LL + (&[0i32])[0];
53
+ |
44
54
45
55
error: casts cannot be followed by a method call
46
56
--> $DIR/issue-35813-postfix-after-cast.rs:39:13
@@ -52,6 +62,11 @@ help: try surrounding the expression in parentheses
52
62
|
53
63
LL | let _ = (0i32: i32: i32).count_ones();
54
64
| + +
65
+ help: alternatively, remove the type ascription
66
+ |
67
+ LL - let _ = 0i32: i32: i32.count_ones();
68
+ LL + let _ = 0i32: i32.count_ones();
69
+ |
55
70
56
71
error: casts cannot be followed by a method call
57
72
--> $DIR/issue-35813-postfix-after-cast.rs:41:13
@@ -63,6 +78,11 @@ help: try surrounding the expression in parentheses
63
78
|
64
79
LL | let _ = (0 as i32: i32).count_ones();
65
80
| + +
81
+ help: alternatively, remove the type ascription
82
+ |
83
+ LL - let _ = 0 as i32: i32.count_ones();
84
+ LL + let _ = 0 as i32.count_ones();
85
+ |
66
86
67
87
error: casts cannot be followed by a method call
68
88
--> $DIR/issue-35813-postfix-after-cast.rs:43:13
@@ -107,6 +127,11 @@ help: try surrounding the expression in parentheses
107
127
|
108
128
LL | let _ = (0i32: i32).count_ones(): u32;
109
129
| + +
130
+ help: alternatively, remove the type ascription
131
+ |
132
+ LL - let _ = 0i32: i32.count_ones(): u32;
133
+ LL + let _ = 0i32.count_ones(): u32;
134
+ |
110
135
111
136
error: casts cannot be followed by a method call
112
137
--> $DIR/issue-35813-postfix-after-cast.rs:51:13
@@ -129,6 +154,11 @@ help: try surrounding the expression in parentheses
129
154
|
130
155
LL | let _ = (0i32: i32).count_ones() as u32;
131
156
| + +
157
+ help: alternatively, remove the type ascription
158
+ |
159
+ LL - let _ = 0i32: i32.count_ones() as u32;
160
+ LL + let _ = 0i32.count_ones() as u32;
161
+ |
132
162
133
163
error: casts cannot be followed by a method call
134
164
--> $DIR/issue-35813-postfix-after-cast.rs:55:13
@@ -151,6 +181,11 @@ help: try surrounding the expression in parentheses
151
181
|
152
182
LL | let _ = (0i32: i32: i32).count_ones() as u32 as i32;
153
183
| + +
184
+ help: alternatively, remove the type ascription
185
+ |
186
+ LL - let _ = 0i32: i32: i32.count_ones() as u32 as i32;
187
+ LL + let _ = 0i32: i32.count_ones() as u32 as i32;
188
+ |
154
189
155
190
error: casts cannot be followed by a method call
156
191
--> $DIR/issue-35813-postfix-after-cast.rs:62:13
@@ -198,6 +233,11 @@ help: try surrounding the expression in parentheses
198
233
|
199
234
LL | (0: i32).max(0);
200
235
| + +
236
+ help: alternatively, remove the type ascription
237
+ |
238
+ LL - 0: i32.max(0);
239
+ LL + 0.max(0);
240
+ |
201
241
202
242
error: casts cannot be followed by a method call
203
243
--> $DIR/issue-35813-postfix-after-cast.rs:92:8
@@ -220,6 +260,11 @@ help: try surrounding the expression in parentheses
220
260
|
221
261
LL | if (5u64: u64).max(0) == 0 {
222
262
| + +
263
+ help: alternatively, remove the type ascription
264
+ |
265
+ LL - if 5u64: u64.max(0) == 0 {
266
+ LL + if 5u64.max(0) == 0 {
267
+ |
223
268
224
269
error: casts cannot be followed by a method call
225
270
--> $DIR/issue-35813-postfix-after-cast.rs:102:9
@@ -242,6 +287,11 @@ help: try surrounding the expression in parentheses
242
287
|
243
288
LL | (5u64: u64).max(0) == 0
244
289
| + +
290
+ help: alternatively, remove the type ascription
291
+ |
292
+ LL - 5u64: u64.max(0) == 0
293
+ LL + 5u64.max(0) == 0
294
+ |
245
295
246
296
error: casts cannot be followed by indexing
247
297
--> $DIR/issue-35813-postfix-after-cast.rs:111:24
@@ -264,6 +314,11 @@ help: try surrounding the expression in parentheses
264
314
|
265
315
LL | static bar2: &[i32] = &((&[1i32,2,3]: &[i32; 3])[0..1]);
266
316
| + +
317
+ help: alternatively, remove the type ascription
318
+ |
319
+ LL - static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]);
320
+ LL + static bar2: &[i32] = &(&[1i32,2,3][0..1]);
321
+ |
267
322
268
323
error: casts cannot be followed by `?`
269
324
--> $DIR/issue-35813-postfix-after-cast.rs:119:5
@@ -286,6 +341,11 @@ help: try surrounding the expression in parentheses
286
341
|
287
342
LL | (Err(0u64): Result<u64,u64>)?;
288
343
| + +
344
+ help: alternatively, remove the type ascription
345
+ |
346
+ LL - Err(0u64): Result<u64,u64>?;
347
+ LL + Err(0u64)?;
348
+ |
289
349
290
350
error: casts cannot be followed by a function call
291
351
--> $DIR/issue-35813-postfix-after-cast.rs:145:5
@@ -308,6 +368,11 @@ help: try surrounding the expression in parentheses
308
368
|
309
369
LL | (drop_ptr: fn(u8))(0);
310
370
| + +
371
+ help: alternatively, remove the type ascription
372
+ |
373
+ LL - drop_ptr: fn(u8)(0);
374
+ LL + drop_ptr(0);
375
+ |
311
376
312
377
error: casts cannot be followed by `.await`
313
378
--> $DIR/issue-35813-postfix-after-cast.rs:152:5
@@ -330,6 +395,11 @@ help: try surrounding the expression in parentheses
330
395
|
331
396
LL | (Box::pin(noop()): Pin<Box<_>>).await;
332
397
| + +
398
+ help: alternatively, remove the type ascription
399
+ |
400
+ LL - Box::pin(noop()): Pin<Box<_>>.await;
401
+ LL + Box::pin(noop()).await;
402
+ |
333
403
334
404
error: casts cannot be followed by a field access
335
405
--> $DIR/issue-35813-postfix-after-cast.rs:167:5
@@ -352,6 +422,11 @@ help: try surrounding the expression in parentheses
352
422
|
353
423
LL | (Foo::default(): Foo).bar;
354
424
| + +
425
+ help: alternatively, remove the type ascription
426
+ |
427
+ LL - Foo::default(): Foo.bar;
428
+ LL + Foo::default().bar;
429
+ |
355
430
356
431
error: casts cannot be followed by a method call
357
432
--> $DIR/issue-35813-postfix-after-cast.rs:84:9
@@ -374,6 +449,11 @@ help: try surrounding the expression in parentheses
374
449
|
375
450
LL | (if true { 33 } else { 44 }: i32).max(0)
376
451
| + +
452
+ help: alternatively, remove the type ascription
453
+ |
454
+ LL - if true { 33 } else { 44 }: i32.max(0)
455
+ LL + if true { 33 } else { 44 }.max(0)
456
+ |
377
457
378
458
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
379
459
--> $DIR/issue-35813-postfix-after-cast.rs:131:13
0 commit comments