rust/src/test/ui/coercion/coercion-slice.rs

8 lines
184 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 array `[{integer}; 1]`
2014-11-04 21:44:48 -06:00
}