Skip to content

Commit

Permalink
fix comments in required-consts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 20, 2024
1 parent 712fe36 commit 91b35a1
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 34 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-drop.rs:9:19
--> $DIR/collect-in-dead-drop.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-drop.rs:16:17
--> $DIR/collect-in-dead-drop.rs:15:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
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-drop.rs:9:19
--> $DIR/collect-in-dead-drop.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-drop.rs:16:17
--> $DIR/collect-in-dead-drop.rs:15:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/required-consts/collect-in-dead-drop.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@revisions: noopt opt
//@ build-fail
//@[opt] compile-flags: -O
//! 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)
//! This fails without optimizations, so it should also fail with optimizations.
struct Fail<T>(T);
impl<T> Fail<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-fn.rs:9:19
--> $DIR/collect-in-dead-fn.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-fn.rs:19:17
--> $DIR/collect-in-dead-fn.rs:18:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-fn.rs:26:9
--> $DIR/collect-in-dead-fn.rs:25:9
|
LL | not_called::<T>();
| ^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/consts/required-consts/collect-in-dead-fn.opt.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-fn.rs:9:19
--> $DIR/collect-in-dead-fn.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-fn.rs:19:17
--> $DIR/collect-in-dead-fn.rs:18:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-fn.rs:26:9
--> $DIR/collect-in-dead-fn.rs:25:9
|
LL | not_called::<T>();
| ^^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/required-consts/collect-in-dead-fn.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@revisions: noopt opt
//@ build-fail
//@[opt] compile-flags: -O
//! 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)
//! This fails without optimizations, so it should also fail with optimizations.
struct Fail<T>(T);
impl<T> Fail<T> {
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/required-consts/collect-in-dead-forget.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@revisions: noopt opt
//@build-pass
//@[opt] compile-flags: -O
//! 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)
//! This passes without optimizations, so it can (and should) also pass with optimizations.
struct Fail<T>(T);
impl<T> Fail<T> {
Expand Down
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-move.rs:9:19
--> $DIR/collect-in-dead-move.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-move.rs:16:17
--> $DIR/collect-in-dead-move.rs:15:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
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-move.rs:9:19
--> $DIR/collect-in-dead-move.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:8: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: erroneous constant encountered
--> $DIR/collect-in-dead-move.rs:16:17
--> $DIR/collect-in-dead-move.rs:15:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/required-consts/collect-in-dead-move.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@revisions: noopt opt
//@ build-fail
//@[opt] compile-flags: -O
//! 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)
//! This fails without optimizations, so it should also fail with optimizations.
struct Fail<T>(T);
impl<T> Fail<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-vtable.rs:12:19
--> $DIR/collect-in-dead-vtable.rs:11:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:12:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:11: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: erroneous constant encountered
--> $DIR/collect-in-dead-vtable.rs:26:21
--> $DIR/collect-in-dead-vtable.rs:25:21
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn <std::vec::Vec<i32> as MyTrait>::not_called`
--> $DIR/collect-in-dead-vtable.rs:35:40
--> $DIR/collect-in-dead-vtable.rs:34:40
|
LL | let gen_vtable: &dyn MyTrait = &v; // vtable "appears" here
| ^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/required-consts/collect-in-dead-vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
//FIXME: `opt` revision currently does not stop with an error due to
//<https://github.com/rust-lang/rust/issues/107503>.
//@[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)
//! This fails without optimizations, so it should also fail with optimizations.
struct Fail<T>(T);
impl<T> Fail<T> {
Expand Down

0 comments on commit 91b35a1

Please sign in to comment.