From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/consts/const-eval/const-eval-query-stack.rs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/ui/consts/const-eval/const-eval-query-stack.rs (limited to 'src/test/ui/consts/const-eval/const-eval-query-stack.rs') diff --git a/src/test/ui/consts/const-eval/const-eval-query-stack.rs b/src/test/ui/consts/const-eval/const-eval-query-stack.rs new file mode 100644 index 000000000..c94604989 --- /dev/null +++ b/src/test/ui/consts/const-eval/const-eval-query-stack.rs @@ -0,0 +1,28 @@ +// compile-flags: -Ztreat-err-as-bug=2 +// build-fail +// failure-status: 101 +// rustc-env:RUST_BACKTRACE=1 +// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> "" +// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" +// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" +// normalize-stderr-test "note: compiler flags.*\n\n" -> "" +// normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" +// normalize-stderr-test "thread.*panicked.*\n" -> "" +// normalize-stderr-test "stack backtrace:\n" -> "" +// normalize-stderr-test "\s\d{1,}: .*\n" -> "" +// normalize-stderr-test "\s at .*\n" -> "" +// normalize-stderr-test ".*note: Some details.*\n" -> "" + +#![allow(unconditional_panic)] + +#[warn(const_err)] +const X: i32 = 1 / 0; //~WARN any use of this value will cause an error +//~| WARN this was previously accepted by the compiler but is being phased out + +fn main() { + let x: &'static i32 = &X; + //~^ ERROR evaluation of constant value failed + //~| ERROR erroneous constant used + //~| WARNING this was previously accepted by the compiler + println!("x={}", x); +} -- cgit v1.2.3