Skip to content

Commit

Permalink
explicitly set opt-level=0
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 20, 2024
1 parent 0d6a16a commit 682991d
Show file tree
Hide file tree
Showing 43 changed files with 109 additions and 94 deletions.
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-called-fn.rs:9:19
--> $DIR/collect-in-called-fn.rs:10:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.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: erroneous constant encountered
--> $DIR/collect-in-called-fn.rs:18:17
--> $DIR/collect-in-called-fn.rs:19:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn called::<i32>`
--> $DIR/collect-in-called-fn.rs:23:5
--> $DIR/collect-in-called-fn.rs:24:5
|
LL | called::<i32>();
| ^^^^^^^^^^^^^^^
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-called-fn.rs:9:19
--> $DIR/collect-in-called-fn.rs:10:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.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: erroneous constant encountered
--> $DIR/collect-in-called-fn.rs:18:17
--> $DIR/collect-in-called-fn.rs:19:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn called::<i32>`
--> $DIR/collect-in-called-fn.rs:23:5
--> $DIR/collect-in-called-fn.rs:24:5
|
LL | called::<i32>();
| ^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/required-consts/collect-in-called-fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[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)
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-closure.rs:8:19
--> $DIR/collect-in-dead-closure.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9: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-closure.rs:16:17
--> $DIR/collect-in-dead-closure.rs:17:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-closure.rs:23:33
--> $DIR/collect-in-dead-closure.rs:24:33
|
LL | let _closure: fn() = || not_called::<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-closure.rs:8:19
--> $DIR/collect-in-dead-closure.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9: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-closure.rs:16:17
--> $DIR/collect-in-dead-closure.rs:17:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-closure.rs:23:33
--> $DIR/collect-in-dead-closure.rs:24:33
|
LL | let _closure: fn() = || not_called::<T>();
| ^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/required-consts/collect-in-dead-closure.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
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:8:19
--> $DIR/collect-in-dead-drop.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9: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:15:17
--> $DIR/collect-in-dead-drop.rs:16: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:8:19
--> $DIR/collect-in-dead-drop.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9: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:15:17
--> $DIR/collect-in-dead-drop.rs:16:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/required-consts/collect-in-dead-drop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
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-fn-behind-assoc-type.rs:9:19
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.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: erroneous constant encountered
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:14:17
--> $DIR/collect-in-dead-fn-behind-assoc-type.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-fn-behind-assoc-type.rs:9:19
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:9:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.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: erroneous constant encountered
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:14:17
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:15:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![feature(impl_trait_in_assoc_type)]
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
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-fn-behind-generic.rs:8:19
--> $DIR/collect-in-dead-fn-behind-generic.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9: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-behind-generic.rs:13:17
--> $DIR/collect-in-dead-fn-behind-generic.rs:14: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-fn-behind-generic.rs:8:19
--> $DIR/collect-in-dead-fn-behind-generic.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9: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-behind-generic.rs:13:17
--> $DIR/collect-in-dead-fn-behind-generic.rs:14:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0080]: evaluation of `m::Fail::<i32>::C` failed
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
|
= 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-behind-opaque-type.rs:17:21
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:18:21
|
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 `m::Fail::<i32>::C` failed
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
|
= 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-behind-opaque-type.rs:17:21
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:18:21
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
#![feature(type_alias_impl_trait)]
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:8:19
--> $DIR/collect-in-dead-fn.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9: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:18:17
--> $DIR/collect-in-dead-fn.rs:19:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-fn.rs:25:9
--> $DIR/collect-in-dead-fn.rs:26: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:8:19
--> $DIR/collect-in-dead-fn.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9: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:18:17
--> $DIR/collect-in-dead-fn.rs:19:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-fn.rs:25:9
--> $DIR/collect-in-dead-fn.rs:26:9
|
LL | not_called::<T>();
| ^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/required-consts/collect-in-dead-fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0080]: evaluation of `Late::<i32>::FAIL` failed
--> $DIR/collect-in-dead-fnptr-in-const.rs:8:22
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:22
|
LL | const FAIL: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:8:22
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22
|
= 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-fnptr-in-const.rs:9:28
--> $DIR/collect-in-dead-fnptr-in-const.rs:10:28
|
LL | const FNPTR: fn() = || Self::FAIL;
| ^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0080]: evaluation of `Late::<i32>::FAIL` failed
--> $DIR/collect-in-dead-fnptr-in-const.rs:8:22
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:22
|
LL | const FAIL: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:8:22
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22
|
= 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-fnptr-in-const.rs:9:28
--> $DIR/collect-in-dead-fnptr-in-const.rs:10:28
|
LL | const FNPTR: fn() = || Self::FAIL;
| ^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@revisions: noopt opt
//@ build-fail
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This fails without optimizations, so it should also fail with optimizations.
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-fnptr.rs:8:19
--> $DIR/collect-in-dead-fnptr.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:9: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-fnptr.rs:17:17
--> $DIR/collect-in-dead-fnptr.rs:18:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn not_called::<i32>`
--> $DIR/collect-in-dead-fnptr.rs:26:28
--> $DIR/collect-in-dead-fnptr.rs:27:28
|
LL | let _fnptr: fn() = not_called::<T>;
| ^^^^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit 682991d

Please sign in to comment.