1 error: casts cannot be followed by indexing
2 --> $DIR/issue-35813-postfix-after-cast.rs:10:5
4 LL | vec![1, 2, 3] as Vec<i32>[0];
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^
7 help: try surrounding the expression in parentheses
9 LL | (vec![1, 2, 3] as Vec<i32>)[0];
12 error: casts cannot be followed by indexing
13 --> $DIR/issue-35813-postfix-after-cast.rs:12:5
15 LL | vec![1, 2, 3]: Vec<i32>[0];
16 | ^^^^^^^^^^^^^^^^^^^^^^^
18 help: try surrounding the expression in parentheses
20 LL | (vec![1, 2, 3]: Vec<i32>)[0];
23 error: casts cannot be followed by indexing
24 --> $DIR/issue-35813-postfix-after-cast.rs:17:5
26 LL | (&[0]) as &[i32][0];
29 help: try surrounding the expression in parentheses
31 LL | ((&[0]) as &[i32])[0];
34 error: casts cannot be followed by indexing
35 --> $DIR/issue-35813-postfix-after-cast.rs:19:5
37 LL | (&[0i32]): &[i32; 1][0];
38 | ^^^^^^^^^^^^^^^^^^^^
40 help: try surrounding the expression in parentheses
42 LL | ((&[0i32]): &[i32; 1])[0];
45 error: casts cannot be followed by a method call
46 --> $DIR/issue-35813-postfix-after-cast.rs:39:13
48 LL | let _ = 0i32: i32: i32.count_ones();
51 help: try surrounding the expression in parentheses
53 LL | let _ = (0i32: i32: i32).count_ones();
56 error: casts cannot be followed by a method call
57 --> $DIR/issue-35813-postfix-after-cast.rs:41:13
59 LL | let _ = 0 as i32: i32.count_ones();
62 help: try surrounding the expression in parentheses
64 LL | let _ = (0 as i32: i32).count_ones();
67 error: casts cannot be followed by a method call
68 --> $DIR/issue-35813-postfix-after-cast.rs:43:13
70 LL | let _ = 0i32: i32 as i32.count_ones();
73 help: try surrounding the expression in parentheses
75 LL | let _ = (0i32: i32 as i32).count_ones();
78 error: casts cannot be followed by a method call
79 --> $DIR/issue-35813-postfix-after-cast.rs:45:13
81 LL | let _ = 0 as i32 as i32.count_ones();
84 help: try surrounding the expression in parentheses
86 LL | let _ = (0 as i32 as i32).count_ones();
89 error: casts cannot be followed by a method call
90 --> $DIR/issue-35813-postfix-after-cast.rs:47:13
92 LL | let _ = 0i32: i32: i32 as u32 as i32.count_ones();
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95 help: try surrounding the expression in parentheses
97 LL | let _ = (0i32: i32: i32 as u32 as i32).count_ones();
100 error: casts cannot be followed by a method call
101 --> $DIR/issue-35813-postfix-after-cast.rs:49:13
103 LL | let _ = 0i32: i32.count_ones(): u32;
106 help: try surrounding the expression in parentheses
108 LL | let _ = (0i32: i32).count_ones(): u32;
111 error: casts cannot be followed by a method call
112 --> $DIR/issue-35813-postfix-after-cast.rs:51:13
114 LL | let _ = 0 as i32.count_ones(): u32;
117 help: try surrounding the expression in parentheses
119 LL | let _ = (0 as i32).count_ones(): u32;
122 error: casts cannot be followed by a method call
123 --> $DIR/issue-35813-postfix-after-cast.rs:53:13
125 LL | let _ = 0i32: i32.count_ones() as u32;
128 help: try surrounding the expression in parentheses
130 LL | let _ = (0i32: i32).count_ones() as u32;
133 error: casts cannot be followed by a method call
134 --> $DIR/issue-35813-postfix-after-cast.rs:55:13
136 LL | let _ = 0 as i32.count_ones() as u32;
139 help: try surrounding the expression in parentheses
141 LL | let _ = (0 as i32).count_ones() as u32;
144 error: casts cannot be followed by a method call
145 --> $DIR/issue-35813-postfix-after-cast.rs:57:13
147 LL | let _ = 0i32: i32: i32.count_ones() as u32 as i32;
150 help: try surrounding the expression in parentheses
152 LL | let _ = (0i32: i32: i32).count_ones() as u32 as i32;
155 error: casts cannot be followed by a method call
156 --> $DIR/issue-35813-postfix-after-cast.rs:62:13
163 help: try surrounding the expression in parentheses
169 error: casts cannot be followed by indexing
170 --> $DIR/issue-35813-postfix-after-cast.rs:70:18
172 LL | let x: i32 = &vec![1, 2, 3] as &Vec<i32>[0];
173 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
175 help: try surrounding the expression in parentheses
177 LL | let x: i32 = (&vec![1, 2, 3] as &Vec<i32>)[0];
180 error: casts cannot be followed by a method call
181 --> $DIR/issue-35813-postfix-after-cast.rs:75:5
183 LL | 0 as i32.max(0);
186 help: try surrounding the expression in parentheses
188 LL | (0 as i32).max(0);
191 error: casts cannot be followed by a method call
192 --> $DIR/issue-35813-postfix-after-cast.rs:77:5
197 help: try surrounding the expression in parentheses
199 LL | (0: i32).max(0);
202 error: casts cannot be followed by a method call
203 --> $DIR/issue-35813-postfix-after-cast.rs:92:8
205 LL | if 5u64 as i32.max(0) == 0 {
208 help: try surrounding the expression in parentheses
210 LL | if (5u64 as i32).max(0) == 0 {
213 error: casts cannot be followed by a method call
214 --> $DIR/issue-35813-postfix-after-cast.rs:95:8
216 LL | if 5u64: u64.max(0) == 0 {
219 help: try surrounding the expression in parentheses
221 LL | if (5u64: u64).max(0) == 0 {
224 error: casts cannot be followed by a method call
225 --> $DIR/issue-35813-postfix-after-cast.rs:102:9
227 LL | 5u64 as u32.max(0) == 0
230 help: try surrounding the expression in parentheses
232 LL | (5u64 as u32).max(0) == 0
235 error: casts cannot be followed by a method call
236 --> $DIR/issue-35813-postfix-after-cast.rs:106:9
238 LL | 5u64: u64.max(0) == 0
241 help: try surrounding the expression in parentheses
243 LL | (5u64: u64).max(0) == 0
246 error: casts cannot be followed by indexing
247 --> $DIR/issue-35813-postfix-after-cast.rs:111:24
249 LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
252 help: try surrounding the expression in parentheses
254 LL | static bar: &[i32] = &((&[1,2,3] as &[i32])[0..1]);
257 error: casts cannot be followed by indexing
258 --> $DIR/issue-35813-postfix-after-cast.rs:114:25
260 LL | static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]);
261 | ^^^^^^^^^^^^^^^^^^^^^^
263 help: try surrounding the expression in parentheses
265 LL | static bar2: &[i32] = &((&[1i32,2,3]: &[i32; 3])[0..1]);
268 error: casts cannot be followed by ?
269 --> $DIR/issue-35813-postfix-after-cast.rs:119:5
271 LL | Err(0u64) as Result<u64,u64>?;
272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274 help: try surrounding the expression in parentheses
276 LL | (Err(0u64) as Result<u64,u64>)?;
279 error: casts cannot be followed by ?
280 --> $DIR/issue-35813-postfix-after-cast.rs:121:5
282 LL | Err(0u64): Result<u64,u64>?;
283 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
285 help: try surrounding the expression in parentheses
287 LL | (Err(0u64): Result<u64,u64>)?;
290 error: casts cannot be followed by a function call
291 --> $DIR/issue-35813-postfix-after-cast.rs:145:5
293 LL | drop as fn(u8)(0);
296 help: try surrounding the expression in parentheses
298 LL | (drop as fn(u8))(0);
301 error: casts cannot be followed by a function call
302 --> $DIR/issue-35813-postfix-after-cast.rs:147:5
304 LL | drop_ptr: fn(u8)(0);
307 help: try surrounding the expression in parentheses
309 LL | (drop_ptr: fn(u8))(0);
312 error: casts cannot be followed by `.await`
313 --> $DIR/issue-35813-postfix-after-cast.rs:152:5
315 LL | Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>.await;
316 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
318 help: try surrounding the expression in parentheses
320 LL | (Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>).await;
323 error: casts cannot be followed by `.await`
324 --> $DIR/issue-35813-postfix-after-cast.rs:155:5
326 LL | Box::pin(noop()): Pin<Box<_>>.await;
327 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
329 help: try surrounding the expression in parentheses
331 LL | (Box::pin(noop()): Pin<Box<_>>).await;
334 error: casts cannot be followed by a field access
335 --> $DIR/issue-35813-postfix-after-cast.rs:167:5
337 LL | Foo::default() as Foo.bar;
338 | ^^^^^^^^^^^^^^^^^^^^^
340 help: try surrounding the expression in parentheses
342 LL | (Foo::default() as Foo).bar;
345 error: casts cannot be followed by a field access
346 --> $DIR/issue-35813-postfix-after-cast.rs:169:5
348 LL | Foo::default(): Foo.bar;
349 | ^^^^^^^^^^^^^^^^^^^
351 help: try surrounding the expression in parentheses
353 LL | (Foo::default(): Foo).bar;
356 error: casts cannot be followed by a method call
357 --> $DIR/issue-35813-postfix-after-cast.rs:84:9
359 LL | if true { 33 } else { 44 } as i32.max(0),
360 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
362 help: try surrounding the expression in parentheses
364 LL | (if true { 33 } else { 44 } as i32).max(0),
367 error: casts cannot be followed by a method call
368 --> $DIR/issue-35813-postfix-after-cast.rs:86:9
370 LL | if true { 33 } else { 44 }: i32.max(0)
371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
373 help: try surrounding the expression in parentheses
375 LL | (if true { 33 } else { 44 }: i32).max(0)
378 error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
379 --> $DIR/issue-35813-postfix-after-cast.rs:131:13
382 | ^^^ only `Fn` traits may use parentheses
384 error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
385 --> $DIR/issue-35813-postfix-after-cast.rs:133:15
388 | ^^^ only `Fn` traits may use parentheses
390 error: aborting due to 36 previous errors
392 For more information about this error, try `rustc --explain E0214`.