1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Regression test for issue #3645
16 //~^ ERROR attempt to use a non-constant value in a constant [E0435]
18 //~^ ERROR mismatched types
19 //~| expected type `usize`
21 //~| expected usize, found ()
23 //~^ ERROR mismatched types
24 //~| expected usize, found bool
26 //~^ ERROR mismatched types
27 //~| expected type `usize`
28 //~| found type `{float}`
29 //~| expected usize, found floating-point variable
31 //~^ ERROR mismatched types
32 //~| expected type `usize`
33 //~| found type `&'static str`
34 //~| expected usize, found reference
35 let f = [0; -4_isize];
36 //~^ ERROR mismatched types
37 //~| expected usize, found isize
38 let f = [0_usize; -1_isize];
39 //~^ ERROR mismatched types
40 //~| expected usize, found isize
44 let g = [0; G { g: () }];
45 //~^ ERROR mismatched types
46 //~| expected type `usize`
47 //~| found type `main::G`
48 //~| expected usize, found struct `main::G`