From 8ed225ac85b25ac9de2a3b04905b336075e27aa7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 13 Mar 2024 16:43:13 +0100 Subject: [PATCH] does not work: make the test build-pass for the opt revision --- .../required-consts/collect-in-dead-vtable.no-opt.stderr | 6 +++--- tests/ui/consts/required-consts/collect-in-dead-vtable.rs | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.no-opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-vtable.no-opt.stderr index 0cfb7c4afabc..c761b36739a1 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-vtable.no-opt.stderr +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.no-opt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::::C` failed - --> $DIR/collect-in-dead-vtable.rs:11:19 + --> $DIR/collect-in-dead-vtable.rs:10:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:11:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:10:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: the above error was encountered while instantiating `fn as MyTrait>::not_called` - --> $DIR/collect-in-dead-vtable.rs:34:40 + --> $DIR/collect-in-dead-vtable.rs:33:40 | LL | let gen_vtable: &dyn MyTrait = &v; // vtable "appears" here | ^^ diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs index b25b3d75289d..59e6ab2b98aa 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs @@ -1,8 +1,7 @@ -//@revisions: no-opt -//FIXME: `opt` revision currently does not stop with an error due to -//. -//@ build-fail +//@revisions: no-opt opt +//@[no-opt] build-fail //@[opt] compile-flags: -O +//@[opt] build-pass //! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is //! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090)