]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-err-late.rs
suggest fix for attempted integer identifier in patterns
[rust.git] / tests / ui / consts / const-err-late.rs
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() {
19     black_box((S::<i32>::FOO, S::<u32>::FOO)); //~ constant
20 }