Skip to content

Commit 003214e

Browse files
committed
adjust tests to reality
1 parent f2b8866 commit 003214e

5 files changed

+17
-25
lines changed

tests/ui/consts/required-consts/dead-code-in-dead-drop.no-opt.stderr renamed to tests/ui/consts/required-consts/dead-code-in-dead-drop.noopt.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/dead-code-in-dead-drop.rs:9:19
2+
--> $DIR/dead-code-in-dead-drop.rs:12:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/dead-code-in-dead-drop.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/dead-code-in-dead-drop.rs:12:19
66
|
77
= 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)
88

tests/ui/consts/required-consts/dead-code-in-dead-drop.opt.stderr

-14
This file was deleted.

tests/ui/consts/required-consts/dead-code-in-dead-drop.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
//@revisions: opt no-opt
2-
//@ build-fail
1+
//@revisions: noopt opt
2+
//@[noopt] build-fail
33
//@[opt] compile-flags: -O
4+
//FIXME: `opt` revision currently does not stop with an error due to
5+
//<https://github.com/rust-lang/rust/issues/107503>.
6+
//@[opt] build-pass
47
//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is
58
//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090)
69
710
struct Fail<T>(T);
811
impl<T> Fail<T> {
9-
const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed
12+
const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed
1013
}
1114

1215
// This function is not actually called, but is mentioned implicitly as destructor in dead code in a

tests/ui/consts/required-consts/dead-code-in-dead-vtable.no-opt.stderr renamed to tests/ui/consts/required-consts/dead-code-in-dead-vtable.noopt.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/dead-code-in-dead-vtable.rs:9:19
2+
--> $DIR/dead-code-in-dead-vtable.rs:12:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/dead-code-in-dead-vtable.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/dead-code-in-dead-vtable.rs:12:19
66
|
77
= 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)
88

99
note: the above error was encountered while instantiating `fn <std::vec::Vec<i32> as MyTrait>::not_called`
10-
--> $DIR/dead-code-in-dead-vtable.rs:30:40
10+
--> $DIR/dead-code-in-dead-vtable.rs:35:40
1111
|
1212
LL | let gen_vtable: &dyn MyTrait = &v; // vtable "appears" here
1313
| ^^

tests/ui/consts/required-consts/dead-code-in-dead-vtable.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
//@revisions: opt no-opt
2-
//@ build-fail
1+
//@revisions: noopt opt
2+
//@[noopt] build-fail
33
//@[opt] compile-flags: -O
4+
//FIXME: `opt` revision currently does not stop with an error due to
5+
//<https://github.com/rust-lang/rust/issues/107503>.
6+
//@[opt] build-pass
47
//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is
58
//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090)
69
710
struct Fail<T>(T);
811
impl<T> Fail<T> {
9-
const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed
12+
const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed
1013
}
1114

1215
trait MyTrait {

0 commit comments

Comments
 (0)