Skip to content

Commit

Permalink
does not work: make the test build-pass for the opt revision
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 13, 2024
1 parent 2d1acd9 commit 8ed225a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::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 <std::vec::Vec<i32> 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
| ^^
Expand Down
7 changes: 3 additions & 4 deletions tests/ui/consts/required-consts/collect-in-dead-vtable.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@revisions: no-opt
//FIXME: `opt` revision currently does not stop with an error due to
//<https://github.com/rust-lang/rust/issues/107503>.
//@ 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)
Expand Down

0 comments on commit 8ed225a

Please sign in to comment.