rust/src/test/ui/array-not-vector.rs
2019-11-18 11:03:04 -08:00

13 lines
305 B
Rust

fn main() {
let _x: i32 = [1, 2, 3];
//~^ ERROR mismatched types
//~| expected `i32`, found array
let x: &[i32] = &[1, 2, 3];
let _y: &i32 = x;
//~^ ERROR mismatched types
//~| expected reference `&i32`
//~| found reference `&[i32]`
//~| expected `i32`, found slice
}