rust/tests/ui/issues/issue-17441.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
455 B
Rust
Raw Normal View History

2014-09-27 14:22:32 -05:00
fn main() {
let _foo = &[1_usize, 2] as [usize];
2014-12-05 20:12:25 -06:00
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
2019-05-28 13:46:13 -05:00
let _bar = Box::new(1_usize) as dyn std::fmt::Debug;
//~^ ERROR cast to unsized type: `Box<usize>` as `dyn Debug`
2019-05-28 13:46:13 -05:00
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];
2014-12-05 20:12:25 -06:00
//~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]`
2014-09-27 14:22:32 -05:00
}