summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-17441.rs
blob: e5f83c4ebadd881da25ee91288a107a46080de0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn main() {
    let _foo = &[1_usize, 2] as [usize];
    //~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`

    let _bar = Box::new(1_usize) as dyn std::fmt::Debug;
    //~^ ERROR cast to unsized type: `Box<usize>` as `dyn Debug`

    let _baz = 1_usize as dyn std::fmt::Debug;
    //~^ ERROR cast to unsized type: `usize` as `dyn Debug`

    let _quux = [1_usize, 2] as [usize];
    //~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]`
}