about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec/array-not-vector.rs
blob: 7345f7219186ace88d3c7fe59e5180de15ef0e50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ dont-require-annotations: NOTE

fn main() {
    let _x: i32 = [1, 2, 3];
    //~^ ERROR mismatched types
    //~| NOTE expected `i32`, found `[{integer}; 3]`

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