rust/tests/ui/array-slice-vec/array-not-vector.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
320 B
Rust
Raw Normal View History

fn main() {
let _x: i32 = [1, 2, 3];
2015-01-12 00:01:44 -06:00
//~^ ERROR mismatched types
//~| expected `i32`, found `[{integer}; 3]`
let x: &[i32] = &[1, 2, 3];
2015-01-31 10:23:42 -06:00
let _y: &i32 = x;
2015-01-12 00:01:44 -06:00
//~^ ERROR mismatched types
//~| expected reference `&i32`
//~| found reference `&[i32]`
//~| expected `&i32`, found `&[i32]`
}