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/erroneous-const.stderr | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/test/ui/consts/const-eval/erroneous-const.stderr (limited to 'src/test/ui/consts/const-eval/erroneous-const.stderr') diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr new file mode 100644 index 000000000..adfb4cc61 --- /dev/null +++ b/src/test/ui/consts/const-eval/erroneous-const.stderr @@ -0,0 +1,56 @@ +warning: this operation will panic at runtime + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | ^^^^^^^ index out of bounds: the length is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:20 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^^^^^^^^^^^ + +warning: any use of this value will cause an error + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +error[E0080]: could not evaluate static initializer + --> $DIR/erroneous-const.rs:15:17 + | +LL | let _ = PrintName::::VOID; + | ^^^^^^^^^^^^^^^^^^^^ + | | + | referenced constant has errors + | inside `no_codegen::` at $DIR/erroneous-const.rs:15:17 +... +LL | pub static FOO: () = no_codegen::(); + | ------------------- inside `FOO` at $DIR/erroneous-const.rs:19:22 + +error: aborting due to previous error; 2 warnings emitted + +For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + -- cgit v1.2.3