]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/repeat_count.rs
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 expected constant integer for repeat count, found variable [E0307]
18 //~^ ERROR mismatched types
22 //~| found ()) [E0308]
23 //~| ERROR expected positive integer for repeat count, found tuple [E0306]
25 //~^ ERROR mismatched types
28 //~| ERROR expected positive integer for repeat count, found boolean [E0306]
30 //~^ ERROR mismatched types
34 //~| found floating-point variable) [E0308]
35 //~| ERROR expected positive integer for repeat count, found float [E0306]
37 //~^ ERROR mismatched types
39 //~| found `&'static str`
41 //~| found &-ptr) [E0308]
42 //~| ERROR expected positive integer for repeat count, found string literal [E0306]
43 let f
= [0; -4_isize
];
44 //~^ ERROR mismatched types
46 //~| found `isize` [E0308]
47 //~| ERROR mismatched types:
48 //~| expected `usize`,
49 //~| found `isize` [E0307]
50 let f
= [0_usize
; -1_isize
];
51 //~^ ERROR mismatched types
53 //~| found `isize` [E0308]
54 //~| ERROR mismatched types
56 //~| found `isize` [E0307]
60 let g
= [0; G { g: () }
];
61 //~^ ERROR mismatched types
65 //~| found struct `main::G`) [E0308]
66 //~| ERROR expected positive integer for repeat count, found struct [E0306]