2014-08-30 18:32:14 +12:00
|
|
|
fn main() {
|
2015-03-03 10:42:26 +02:00
|
|
|
let _x: i32 = [1, 2, 3];
|
2015-01-12 01:01:44 -05:00
|
|
|
//~^ ERROR mismatched types
|
2023-01-02 18:00:33 -08:00
|
|
|
//~| expected `i32`, found `[{integer}; 3]`
|
2014-08-30 18:32:14 +12:00
|
|
|
|
2015-03-03 10:42:26 +02:00
|
|
|
let x: &[i32] = &[1, 2, 3];
|
2015-01-31 17:23:42 +01:00
|
|
|
let _y: &i32 = x;
|
2015-01-12 01:01:44 -05:00
|
|
|
//~^ ERROR mismatched types
|
2019-11-13 14:16:56 -08:00
|
|
|
//~| expected reference `&i32`
|
|
|
|
//~| found reference `&[i32]`
|
2023-01-02 18:00:33 -08:00
|
|
|
//~| expected `&i32`, found `&[i32]`
|
2014-08-30 18:32:14 +12:00
|
|
|
}
|