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-04 21:44:48 -06:00
fn main() {
let _: &[i32] = [0];
2015-01-12 00:01:44 -06:00
//~^ ERROR mismatched types
//~| expected `&[i32]`, found `[{integer}; 1]`
2014-11-04 21:44:48 -06:00
}