rust/tests/ui/coercion/coercion-slice.rs

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

8 lines
180 B
Rust
Raw Normal View History

// Tests that we forbid coercion from `[T; n]` to `&[T]`
2014-11-05 03:44:48 +00:00
fn main() {
let _: &[i32] = [0];
2015-01-12 06:01:44 +00:00
//~^ ERROR mismatched types
//~| expected `&[i32]`, found `[{integer}; 1]`
2014-11-05 03:44:48 +00:00
}