2023-12-20 19:35:53 -06:00
|
|
|
error[E0620]: cast to unsized type: `&[u8]` as `[char]`
|
|
|
|
--> $DIR/cast-to-slice.rs:2:5
|
|
|
|
|
|
2023-12-20 21:53:56 -06:00
|
|
|
LL | "example".as_bytes() as [char];
|
2023-12-20 19:35:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^------
|
|
|
|
| |
|
|
|
|
| help: try casting to a reference instead: `&[char]`
|
|
|
|
|
|
|
|
error[E0620]: cast to unsized type: `&[u8]` as `[char]`
|
|
|
|
--> $DIR/cast-to-slice.rs:6:5
|
|
|
|
|
|
|
|
|
LL | arr as [char];
|
|
|
|
| ^^^^^^^------
|
|
|
|
| |
|
|
|
|
| help: try casting to a reference instead: `&[char]`
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0620`.
|