]> git.lizzy.rs Git - rust.git/blob - src/test/ui/array-not-vector.rs
838951c7c1d484f7e4fb19a772fbe5c0f8339e57
[rust.git] / src / test / ui / array-not-vector.rs
1 fn main() {
2     let _x: i32 = [1, 2, 3];
3     //~^ ERROR mismatched types
4     //~| expected type `i32`
5     //~| found array `[{integer}; 3]`
6     //~| expected i32, found array of 3 elements
7
8     let x: &[i32] = &[1, 2, 3];
9     let _y: &i32 = x;
10     //~^ ERROR mismatched types
11     //~| expected reference `&i32`
12     //~| found reference `&[i32]`
13     //~| expected i32, found slice
14 }