fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.6 KiB47 linesraw
1error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]`
2  --> $DIR/issue-17441.rs:2:16
3   |
4LL |     let _foo = &[1_usize, 2] as [usize];
5   |                ^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7help: consider using an implicit coercion to `&[usize]` instead
8  --> $DIR/issue-17441.rs:2:16
9   |
10LL |     let _foo = &[1_usize, 2] as [usize];
11   |                ^^^^^^^^^^^^^^^^^^^^^^^^
12
13error[E0620]: cast to unsized type: `std::boxed::Box<usize>` as `dyn std::fmt::Debug`
14  --> $DIR/issue-17441.rs:5:16
15   |
16LL |     let _bar = Box::new(1_usize) as dyn std::fmt::Debug;
17   |                ^^^^^^^^^^^^^^^^^^^^^-------------------
18   |                                     |
19   |                                     help: try casting to a `Box` instead: `Box<dyn std::fmt::Debug>`
20
21error[E0620]: cast to unsized type: `usize` as `dyn std::fmt::Debug`
22  --> $DIR/issue-17441.rs:8:16
23   |
24LL |     let _baz = 1_usize as dyn std::fmt::Debug;
25   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26   |
27help: consider using a box or reference as appropriate
28  --> $DIR/issue-17441.rs:8:16
29   |
30LL |     let _baz = 1_usize as dyn std::fmt::Debug;
31   |                ^^^^^^^
32
33error[E0620]: cast to unsized type: `[usize; 2]` as `[usize]`
34  --> $DIR/issue-17441.rs:11:17
35   |
36LL |     let _quux = [1_usize, 2] as [usize];
37   |                 ^^^^^^^^^^^^^^^^^^^^^^^
38   |
39help: consider using a box or reference as appropriate
40  --> $DIR/issue-17441.rs:11:17
41   |
42LL |     let _quux = [1_usize, 2] as [usize];
43   |                 ^^^^^^^^^^^^
44
45error: aborting due to 4 previous errors
46
47For more information about this error, try `rustc --explain E0620`.