//@ build-fail //@ compile-flags: -C overflow-checks=on #![allow(arithmetic_overflow, unconditional_panic)] fn black_box(_: T) { unimplemented!() } struct S(T); impl S { const FOO: u8 = [5u8][1]; //~^ ERROR evaluation of `S::::FOO` failed //~| ERROR evaluation of `S::::FOO` failed } fn main() { black_box((S::::FOO, S::::FOO)); //~ constant }