2014-08-30 18:32:14 +12:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
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
|
2015-01-31 17:23:42 +01:00
|
|
|
//~| expected `i32`
|
2015-03-04 15:48:33 +02:00
|
|
|
//~| found `[_; 3]`
|
2015-01-31 17:23:42 +01:00
|
|
|
//~| expected i32
|
2015-01-12 01:01:44 -05:00
|
|
|
//~| found array of 3 elements
|
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
|
2015-01-31 17:23:42 +01:00
|
|
|
//~| expected `&i32`
|
|
|
|
//~| found `&[i32]`
|
|
|
|
//~| expected i32
|
2015-01-12 01:01:44 -05:00
|
|
|
//~| found slice
|
2014-08-30 18:32:14 +12:00
|
|
|
}
|