]>
Commit | Line | Data |
---|---|---|
c34b1796 AL |
1 | // Evaluation of constants in array-elem count goes through different |
2 | // compiler control-flow paths. | |
3 | // | |
4 | // This test is checking the count in an array type. | |
5 | ||
6 | #![allow(unused_imports)] | |
7 | ||
8 | use std::fmt; | |
c34b1796 AL |
9 | |
10 | const A_I8_T | |
11 | : [u32; (i8::MAX as i8 + 1i8) as usize] | |
a1dfa0c6 | 12 | //~^ ERROR evaluation of constant value failed |
c34b1796 AL |
13 | = [0; (i8::MAX as usize) + 1]; |
14 | ||
15 | fn main() { | |
16 | foo(&A_I8_T[..]); | |
17 | } | |
18 | ||
19 | fn foo<T:fmt::Debug>(x: T) { | |
20 | println!("{:?}", x); | |
21 | } |