about summary refs log tree commit diff
path: root/src/test/ui/array-not-vector.rs
blob: 80b40ef25c3e0a48d361fb3fdea1ce9296c4f217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn main() {
    let _x: i32 = [1, 2, 3];
    //~^ ERROR mismatched types
    //~| expected type `i32`
    //~| found type `[{integer}; 3]`
    //~| expected i32, found array of 3 elements

    let x: &[i32] = &[1, 2, 3];
    let _y: &i32 = x;
    //~^ ERROR mismatched types
    //~| expected type `&i32`
    //~| found type `&[i32]`
    //~| expected i32, found slice
}