@@ -22,68 +22,128 @@ error: casts cannot be followed by indexing
22
22
LL | (&[0i32]): &[i32; 1][0];
23
23
| ^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0i32]): &[i32; 1])`
24
24
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
+
25
85
error: 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
27
87
|
28
88
LL | let x: i32 = &vec![1, 2, 3] as &Vec<i32>[0];
29
89
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&vec![1, 2, 3] as &Vec<i32>)`
30
90
31
91
error: 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
33
93
|
34
94
LL | 0 as i32.max(0);
35
95
| ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
36
96
37
97
error: 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
39
99
|
40
100
LL | 0: i32.max(0);
41
101
| ^^^^^^ help: try surrounding the expression in parentheses: `(0: i32)`
42
102
43
103
error: 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
45
105
|
46
106
LL | if 5u64 as i32.max(0) == 0 {
47
107
| ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as i32)`
48
108
49
109
error: 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
51
111
|
52
112
LL | if 5u64: u64.max(0) == 0 {
53
113
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
54
114
55
115
error: 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
57
117
|
58
118
LL | 5u64 as u32.max(0) == 0
59
119
| ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as u32)`
60
120
61
121
error: 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
63
123
|
64
124
LL | 5u64: u64.max(0) == 0
65
125
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
66
126
67
127
error: 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
69
129
|
70
130
LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
71
131
| ^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1,2,3] as &[i32])`
72
132
73
133
error: 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
75
135
|
76
136
LL | static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]);
77
137
| ^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1i32,2,3]: &[i32; 3])`
78
138
79
139
error: 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
81
141
|
82
142
LL | Err(0u64) as Result<u64,u64>?;
83
143
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Err(0u64) as Result<u64,u64>)`
84
144
85
145
error: 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
87
147
|
88
148
LL | Err(0u64): Result<u64,u64>?;
89
149
| ^^^^^^^^^-^^^^^^^^^^^^^^^^
@@ -94,25 +154,25 @@ LL | Err(0u64): Result<u64,u64>?;
94
154
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
95
155
96
156
error: 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
98
158
|
99
159
LL | drop as fn(u8)(0);
100
160
| ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop as fn(u8))`
101
161
102
162
error: 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
104
164
|
105
165
LL | drop_ptr: fn(u8)(0);
106
166
| ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop_ptr: fn(u8))`
107
167
108
168
error: 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
110
170
|
111
171
LL | Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>.await;
112
172
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>)`
113
173
114
174
error: 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
116
176
|
117
177
LL | Box::pin(noop()): Pin<Box<_>>.await;
118
178
| ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^
@@ -123,41 +183,41 @@ LL | Box::pin(noop()): Pin<Box<_>>.await;
123
183
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
124
184
125
185
error: 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
127
187
|
128
188
LL | Foo::default() as Foo.bar;
129
189
| ^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default() as Foo)`
130
190
131
191
error: 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
133
193
|
134
194
LL | Foo::default(): Foo.bar;
135
195
| ^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default(): Foo)`
136
196
137
197
error: 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
139
199
|
140
200
LL | if true { 33 } else { 44 } as i32.max(0),
141
201
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 } as i32)`
142
202
143
203
error: 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
145
205
|
146
206
LL | if true { 33 } else { 44 }: i32.max(0)
147
207
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 }: i32)`
148
208
149
209
error[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
151
211
|
152
212
LL | drop as F();
153
213
| ^^^ only `Fn` traits may use parentheses
154
214
155
215
error[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
157
217
|
158
218
LL | drop_ptr: F();
159
219
| ^^^ only `Fn` traits may use parentheses
160
220
161
- error: aborting due to 25 previous errors
221
+ error: aborting due to 35 previous errors
162
222
163
223
For more information about this error, try `rustc --explain E0214`.
0 commit comments