From cf94bdc0742c13e2a0cac864c478b8626b266e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/consts/const-err-late.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/ui/consts/const-err-late.rs (limited to 'src/test/ui/consts/const-err-late.rs') diff --git a/src/test/ui/consts/const-err-late.rs b/src/test/ui/consts/const-err-late.rs new file mode 100644 index 000000000..a20ae7025 --- /dev/null +++ b/src/test/ui/consts/const-err-late.rs @@ -0,0 +1,22 @@ +// 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)); + //~^ ERROR erroneous constant + //~| ERROR erroneous constant +} -- cgit v1.2.3