@@ -22,68 +22,128 @@ error: casts cannot be followed by indexing
2222LL | (&[0i32]): &[i32; 1][0];
2323 | ^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0i32]): &[i32; 1])`
2424
25+ error: casts cannot be followed by a method call
26+ --> $DIR/issue-35813-postfix-after-cast.rs:39:13
27+ |
28+ LL | let _ = 0i32: i32: i32.count_ones();
29+ | ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32)`
30+
31+ error: casts cannot be followed by a method call
32+ --> $DIR/issue-35813-postfix-after-cast.rs:41:13
33+ |
34+ LL | let _ = 0 as i32: i32.count_ones();
35+ | ^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32: i32)`
36+
37+ error: casts cannot be followed by a method call
38+ --> $DIR/issue-35813-postfix-after-cast.rs:43:13
39+ |
40+ LL | let _ = 0i32: i32 as i32.count_ones();
41+ | ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32 as i32)`
42+
43+ error: casts cannot be followed by a method call
44+ --> $DIR/issue-35813-postfix-after-cast.rs:45:13
45+ |
46+ LL | let _ = 0 as i32 as i32.count_ones();
47+ | ^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32 as i32)`
48+
49+ error: casts cannot be followed by a method call
50+ --> $DIR/issue-35813-postfix-after-cast.rs:47:13
51+ |
52+ LL | let _ = 0i32: i32: i32 as u32 as i32.count_ones();
53+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32 as u32 as i32)`
54+
55+ error: casts cannot be followed by a method call
56+ --> $DIR/issue-35813-postfix-after-cast.rs:49:13
57+ |
58+ LL | let _ = 0i32: i32.count_ones(): u32;
59+ | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32)`
60+
61+ error: casts cannot be followed by a method call
62+ --> $DIR/issue-35813-postfix-after-cast.rs:51:13
63+ |
64+ LL | let _ = 0 as i32.count_ones(): u32;
65+ | ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
66+
67+ error: casts cannot be followed by a method call
68+ --> $DIR/issue-35813-postfix-after-cast.rs:53:13
69+ |
70+ LL | let _ = 0i32: i32.count_ones() as u32;
71+ | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32)`
72+
73+ error: casts cannot be followed by a method call
74+ --> $DIR/issue-35813-postfix-after-cast.rs:55:13
75+ |
76+ LL | let _ = 0 as i32.count_ones() as u32;
77+ | ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
78+
79+ error: casts cannot be followed by a method call
80+ --> $DIR/issue-35813-postfix-after-cast.rs:57:13
81+ |
82+ LL | let _ = 0i32: i32: i32.count_ones() as u32 as i32;
83+ | ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32)`
84+
2585error: casts cannot be followed by indexing
26- --> $DIR/issue-35813-postfix-after-cast.rs:40 :18
86+ --> $DIR/issue-35813-postfix-after-cast.rs:63 :18
2787 |
2888LL | let x: i32 = &vec![1, 2, 3] as &Vec<i32>[0];
2989 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&vec![1, 2, 3] as &Vec<i32>)`
3090
3191error: casts cannot be followed by a method call
32- --> $DIR/issue-35813-postfix-after-cast.rs:45 :5
92+ --> $DIR/issue-35813-postfix-after-cast.rs:68 :5
3393 |
3494LL | 0 as i32.max(0);
3595 | ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
3696
3797error: casts cannot be followed by a method call
38- --> $DIR/issue-35813-postfix-after-cast.rs:47 :5
98+ --> $DIR/issue-35813-postfix-after-cast.rs:70 :5
3999 |
40100LL | 0: i32.max(0);
41101 | ^^^^^^ help: try surrounding the expression in parentheses: `(0: i32)`
42102
43103error: casts cannot be followed by a method call
44- --> $DIR/issue-35813-postfix-after-cast.rs:62 :8
104+ --> $DIR/issue-35813-postfix-after-cast.rs:85 :8
45105 |
46106LL | if 5u64 as i32.max(0) == 0 {
47107 | ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as i32)`
48108
49109error: casts cannot be followed by a method call
50- --> $DIR/issue-35813-postfix-after-cast.rs:65 :8
110+ --> $DIR/issue-35813-postfix-after-cast.rs:88 :8
51111 |
52112LL | if 5u64: u64.max(0) == 0 {
53113 | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
54114
55115error: casts cannot be followed by a method call
56- --> $DIR/issue-35813-postfix-after-cast.rs:72 :9
116+ --> $DIR/issue-35813-postfix-after-cast.rs:95 :9
57117 |
58118LL | 5u64 as u32.max(0) == 0
59119 | ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as u32)`
60120
61121error: casts cannot be followed by a method call
62- --> $DIR/issue-35813-postfix-after-cast.rs:76 :9
122+ --> $DIR/issue-35813-postfix-after-cast.rs:99 :9
63123 |
64124LL | 5u64: u64.max(0) == 0
65125 | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
66126
67127error: casts cannot be followed by indexing
68- --> $DIR/issue-35813-postfix-after-cast.rs:81 :24
128+ --> $DIR/issue-35813-postfix-after-cast.rs:104 :24
69129 |
70130LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
71131 | ^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1,2,3] as &[i32])`
72132
73133error: casts cannot be followed by indexing
74- --> $DIR/issue-35813-postfix-after-cast.rs:84 :25
134+ --> $DIR/issue-35813-postfix-after-cast.rs:107 :25
75135 |
76136LL | static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]);
77137 | ^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1i32,2,3]: &[i32; 3])`
78138
79139error: casts cannot be followed by ?
80- --> $DIR/issue-35813-postfix-after-cast.rs:89 :5
140+ --> $DIR/issue-35813-postfix-after-cast.rs:112 :5
81141 |
82142LL | Err(0u64) as Result<u64,u64>?;
83143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Err(0u64) as Result<u64,u64>)`
84144
85145error: casts cannot be followed by ?
86- --> $DIR/issue-35813-postfix-after-cast.rs:91 :5
146+ --> $DIR/issue-35813-postfix-after-cast.rs:114 :5
87147 |
88148LL | Err(0u64): Result<u64,u64>?;
89149 | ^^^^^^^^^-^^^^^^^^^^^^^^^^
@@ -94,25 +154,25 @@ LL | Err(0u64): Result<u64,u64>?;
94154 = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
95155
96156error: casts cannot be followed by a function call
97- --> $DIR/issue-35813-postfix-after-cast.rs:115 :5
157+ --> $DIR/issue-35813-postfix-after-cast.rs:138 :5
98158 |
99159LL | drop as fn(u8)(0);
100160 | ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop as fn(u8))`
101161
102162error: casts cannot be followed by a function call
103- --> $DIR/issue-35813-postfix-after-cast.rs:117 :5
163+ --> $DIR/issue-35813-postfix-after-cast.rs:140 :5
104164 |
105165LL | drop_ptr: fn(u8)(0);
106166 | ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop_ptr: fn(u8))`
107167
108168error: casts cannot be followed by `.await`
109- --> $DIR/issue-35813-postfix-after-cast.rs:122 :5
169+ --> $DIR/issue-35813-postfix-after-cast.rs:145 :5
110170 |
111171LL | Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>.await;
112172 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>)`
113173
114174error: casts cannot be followed by `.await`
115- --> $DIR/issue-35813-postfix-after-cast.rs:125 :5
175+ --> $DIR/issue-35813-postfix-after-cast.rs:148 :5
116176 |
117177LL | Box::pin(noop()): Pin<Box<_>>.await;
118178 | ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^
@@ -123,41 +183,41 @@ LL | Box::pin(noop()): Pin<Box<_>>.await;
123183 = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
124184
125185error: casts cannot be followed by a field access
126- --> $DIR/issue-35813-postfix-after-cast.rs:137 :5
186+ --> $DIR/issue-35813-postfix-after-cast.rs:160 :5
127187 |
128188LL | Foo::default() as Foo.bar;
129189 | ^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default() as Foo)`
130190
131191error: casts cannot be followed by a field access
132- --> $DIR/issue-35813-postfix-after-cast.rs:139 :5
192+ --> $DIR/issue-35813-postfix-after-cast.rs:162 :5
133193 |
134194LL | Foo::default(): Foo.bar;
135195 | ^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default(): Foo)`
136196
137197error: casts cannot be followed by a method call
138- --> $DIR/issue-35813-postfix-after-cast.rs:54 :9
198+ --> $DIR/issue-35813-postfix-after-cast.rs:77 :9
139199 |
140200LL | if true { 33 } else { 44 } as i32.max(0),
141201 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 } as i32)`
142202
143203error: casts cannot be followed by a method call
144- --> $DIR/issue-35813-postfix-after-cast.rs:56 :9
204+ --> $DIR/issue-35813-postfix-after-cast.rs:79 :9
145205 |
146206LL | if true { 33 } else { 44 }: i32.max(0)
147207 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 }: i32)`
148208
149209error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
150- --> $DIR/issue-35813-postfix-after-cast.rs:101 :13
210+ --> $DIR/issue-35813-postfix-after-cast.rs:124 :13
151211 |
152212LL | drop as F();
153213 | ^^^ only `Fn` traits may use parentheses
154214
155215error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
156- --> $DIR/issue-35813-postfix-after-cast.rs:103 :15
216+ --> $DIR/issue-35813-postfix-after-cast.rs:126 :15
157217 |
158218LL | drop_ptr: F();
159219 | ^^^ only `Fn` traits may use parentheses
160220
161- error: aborting due to 25 previous errors
221+ error: aborting due to 35 previous errors
162222
163223For more information about this error, try `rustc --explain E0214`.
0 commit comments