]>
Commit | Line | Data |
---|---|---|
2b03887a FG |
1 | // build-fail |
2 | // compile-flags: -C overflow-checks=on | |
3 | ||
4 | #![allow(arithmetic_overflow, unconditional_panic)] | |
5 | ||
6 | fn black_box<T>(_: T) { | |
7 | unimplemented!() | |
8 | } | |
9 | ||
10 | struct S<T>(T); | |
11 | ||
12 | impl<T> S<T> { | |
13 | const FOO: u8 = [5u8][1]; | |
14 | //~^ ERROR evaluation of `S::<i32>::FOO` failed | |
15 | //~| ERROR evaluation of `S::<u32>::FOO` failed | |
16 | } | |
17 | ||
18 | fn main() { | |
487cf647 | 19 | black_box((S::<i32>::FOO, S::<u32>::FOO)); //~ constant |
2b03887a | 20 | } |