1 // Regression test for issue #3645
6 //~^ ERROR attempt to use a non-constant value in a constant [E0435]
8 //~^ ERROR mismatched types
9 //~| expected type `usize`
11 //~| expected usize, found ()
13 //~^ ERROR mismatched types
14 //~| expected usize, found bool
16 //~^ ERROR mismatched types
17 //~| expected type `usize`
18 //~| found type `{float}`
19 //~| expected usize, found floating-point number
21 //~^ ERROR mismatched types
22 //~| expected type `usize`
23 //~| found type `&'static str`
24 //~| expected usize, found reference
25 let f = [0; -4_isize];
26 //~^ ERROR mismatched types
27 //~| expected usize, found isize
28 let f = [0_usize; -1_isize];
29 //~^ ERROR mismatched types
30 //~| expected usize, found isize
34 let g = [0; G { g: () }];
35 //~^ ERROR mismatched types
36 //~| expected type `usize`
37 //~| found type `main::G`
38 //~| expected usize, found struct `main::G`