1
- error: casting `*const U` as `*const V` is invalid
1
+ error[E0606] : casting `*const U` as `*const V` is invalid
2
2
--> $DIR/cast-rfc0401.rs:13:5
3
3
|
4
4
13 | u as *const V
5
5
| ^^^^^^^^^^^^^
6
6
|
7
7
= note: vtable kinds may not match
8
8
9
- error: casting `*const U` as `*const str` is invalid
9
+ error[E0606] : casting `*const U` as `*const str` is invalid
10
10
--> $DIR/cast-rfc0401.rs:18:5
11
11
|
12
12
18 | u as *const str
@@ -60,27 +60,27 @@ error[E0605]: non-scalar cast: `std::option::Option<&*const u8>` as `*const u8`
60
60
|
61
61
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
62
62
63
- error: casting `*const u8` as `f32` is invalid
63
+ error[E0606] : casting `*const u8` as `f32` is invalid
64
64
--> $DIR/cast-rfc0401.rs:45:13
65
65
|
66
66
45 | let _ = v as f32;
67
67
| ^^^^^^^^
68
68
69
- error: casting `fn() {main}` as `f64` is invalid
69
+ error[E0606] : casting `fn() {main}` as `f64` is invalid
70
70
--> $DIR/cast-rfc0401.rs:46:13
71
71
|
72
72
46 | let _ = main as f64;
73
73
| ^^^^^^^^^^^
74
74
75
- error: casting `&*const u8` as `usize` is invalid
75
+ error[E0606] : casting `&*const u8` as `usize` is invalid
76
76
--> $DIR/cast-rfc0401.rs:47:13
77
77
|
78
78
47 | let _ = &v as usize;
79
79
| ^^^^^^^^^^^
80
80
|
81
81
= help: cast through a raw pointer first
82
82
83
- error: casting `f32` as `*const u8` is invalid
83
+ error[E0606] : casting `f32` as `*const u8` is invalid
84
84
--> $DIR/cast-rfc0401.rs:48:13
85
85
|
86
86
48 | let _ = f as *const u8;
@@ -108,49 +108,49 @@ error[E0604]: only `u8` can be cast as `char`, not `u32`
108
108
51 | let _ = 0x61u32 as char;
109
109
| ^^^^^^^^^^^^^^^
110
110
111
- error: casting `bool` as `f32` is invalid
111
+ error[E0606] : casting `bool` as `f32` is invalid
112
112
--> $DIR/cast-rfc0401.rs:53:13
113
113
|
114
114
53 | let _ = false as f32;
115
115
| ^^^^^^^^^^^^
116
116
|
117
117
= help: cast through an integer first
118
118
119
- error: casting `E` as `f32` is invalid
119
+ error[E0606] : casting `E` as `f32` is invalid
120
120
--> $DIR/cast-rfc0401.rs:54:13
121
121
|
122
122
54 | let _ = E::A as f32;
123
123
| ^^^^^^^^^^^
124
124
|
125
125
= help: cast through an integer first
126
126
127
- error: casting `char` as `f32` is invalid
127
+ error[E0606] : casting `char` as `f32` is invalid
128
128
--> $DIR/cast-rfc0401.rs:55:13
129
129
|
130
130
55 | let _ = 'a' as f32;
131
131
| ^^^^^^^^^^
132
132
|
133
133
= help: cast through an integer first
134
134
135
- error: casting `bool` as `*const u8` is invalid
135
+ error[E0606] : casting `bool` as `*const u8` is invalid
136
136
--> $DIR/cast-rfc0401.rs:57:13
137
137
|
138
138
57 | let _ = false as *const u8;
139
139
| ^^^^^^^^^^^^^^^^^^
140
140
141
- error: casting `E` as `*const u8` is invalid
141
+ error[E0606] : casting `E` as `*const u8` is invalid
142
142
--> $DIR/cast-rfc0401.rs:58:13
143
143
|
144
144
58 | let _ = E::A as *const u8;
145
145
| ^^^^^^^^^^^^^^^^^
146
146
147
- error: casting `char` as `*const u8` is invalid
147
+ error[E0606] : casting `char` as `*const u8` is invalid
148
148
--> $DIR/cast-rfc0401.rs:59:13
149
149
|
150
150
59 | let _ = 'a' as *const u8;
151
151
| ^^^^^^^^^^^^^^^^
152
152
153
- error: casting `usize` as `*const [u8]` is invalid
153
+ error[E0606] : casting `usize` as `*const [u8]` is invalid
154
154
--> $DIR/cast-rfc0401.rs:61:13
155
155
|
156
156
61 | let _ = 42usize as *const [u8];
@@ -162,53 +162,53 @@ error: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
162
162
62 | let _ = v as *const [u8];
163
163
| ^^^^^^^^^^^^^^^^
164
164
165
- error: casting `&Foo` as `*const str` is invalid
165
+ error[E0606] : casting `&Foo` as `*const str` is invalid
166
166
--> $DIR/cast-rfc0401.rs:64:13
167
167
|
168
168
64 | let _ = foo as *const str;
169
169
| ^^^^^^^^^^^^^^^^^
170
170
171
- error: casting `&Foo` as `*mut str` is invalid
171
+ error[E0606] : casting `&Foo` as `*mut str` is invalid
172
172
--> $DIR/cast-rfc0401.rs:65:13
173
173
|
174
174
65 | let _ = foo as *mut str;
175
175
| ^^^^^^^^^^^^^^^
176
176
177
- error: casting `fn() {main}` as `*mut str` is invalid
177
+ error[E0606] : casting `fn() {main}` as `*mut str` is invalid
178
178
--> $DIR/cast-rfc0401.rs:66:13
179
179
|
180
180
66 | let _ = main as *mut str;
181
181
| ^^^^^^^^^^^^^^^^
182
182
183
- error: casting `&f32` as `*mut f32` is invalid
183
+ error[E0606] : casting `&f32` as `*mut f32` is invalid
184
184
--> $DIR/cast-rfc0401.rs:67:13
185
185
|
186
186
67 | let _ = &f as *mut f32;
187
187
| ^^^^^^^^^^^^^^
188
188
189
- error: casting `&f32` as `*const f64` is invalid
189
+ error[E0606] : casting `&f32` as `*const f64` is invalid
190
190
--> $DIR/cast-rfc0401.rs:68:13
191
191
|
192
192
68 | let _ = &f as *const f64;
193
193
| ^^^^^^^^^^^^^^^^
194
194
195
- error: casting `*const [i8]` as `usize` is invalid
195
+ error[E0606] : casting `*const [i8]` as `usize` is invalid
196
196
--> $DIR/cast-rfc0401.rs:69:13
197
197
|
198
198
69 | let _ = fat_sv as usize;
199
199
| ^^^^^^^^^^^^^^^
200
200
|
201
201
= help: cast through a thin pointer first
202
202
203
- error: casting `*const Foo` as `*const [u16]` is invalid
203
+ error[E0606] : casting `*const Foo` as `*const [u16]` is invalid
204
204
--> $DIR/cast-rfc0401.rs:78:13
205
205
|
206
206
78 | let _ = cf as *const [u16];
207
207
| ^^^^^^^^^^^^^^^^^^
208
208
|
209
209
= note: vtable kinds may not match
210
210
211
- error: casting `*const Foo` as `*const Bar` is invalid
211
+ error[E0606] : casting `*const Foo` as `*const Bar` is invalid
212
212
--> $DIR/cast-rfc0401.rs:79:13
213
213
|
214
214
79 | let _ = cf as *const Bar;
@@ -234,7 +234,7 @@ error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
234
234
= help: the trait `std::marker::Sized` is not implemented for `str`
235
235
= note: required for the cast to the object type `Foo`
236
236
237
- error: casting `&{float}` as `f32` is invalid
237
+ error[E0606] : casting `&{float}` as `f32` is invalid
238
238
--> $DIR/cast-rfc0401.rs:81:30
239
239
|
240
240
81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
0 commit comments