rust/src/test/ui/coercion/coercion-slice.rs
2018-12-25 21:08:33 -07:00

9 lines
213 B
Rust

// Tests that we forbid coercion from `[T; n]` to `&[T]`
fn main() {
let _: &[i32] = [0];
//~^ ERROR mismatched types
//~| expected type `&[i32]`
//~| expected &[i32], found array of 1 elements
}