explicitly set opt-level=0

This commit is contained in:
Ralf Jung 2024-03-18 17:54:48 +01:00
parent 0d6a16ac4b
commit 682991d2c7
43 changed files with 109 additions and 94 deletions

View File

@ -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>();
| ^^^^^^^^^^^^^^^

View File

@ -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>();
| ^^^^^^^^^^^^^^^

View File

@ -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)

View File

@ -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>();
| ^^^^^^^^^^^^^^^^^

View File

@ -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>();
| ^^^^^^^^^^^^^^^^^

View File

@ -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.

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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.

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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.

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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.

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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;
| ^^^^^^^^^^^^

View File

@ -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)]

View File

@ -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>();
| ^^^^^^^^^^^^^^^^^

View File

@ -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>();
| ^^^^^^^^^^^^^^^^^

View File

@ -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.

View File

@ -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;
| ^^^^^^^^^^

View File

@ -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;
| ^^^^^^^^^^

View File

@ -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.

View File

@ -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>;
| ^^^^^^^^^^^^^^^

View File

@ -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>;
| ^^^^^^^^^^^^^^^

View File

@ -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.

View File

@ -1,5 +1,6 @@
//@revisions: noopt opt
//@build-pass
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! This passes without optimizations, so it can (and should) also pass with optimizations.

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-move.rs:8:19
--> $DIR/collect-in-dead-move.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.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-move.rs:15:17
--> $DIR/collect-in-dead-move.rs:16:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-move.rs:8:19
--> $DIR/collect-in-dead-move.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.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-move.rs:15:17
--> $DIR/collect-in-dead-move.rs:16:17
|
LL | let _ = Fail::<T>::C;
| ^^^^^^^^^^^^

View File

@ -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.

View File

@ -1,19 +1,19 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-vtable.rs:8:19
--> $DIR/collect-in-dead-vtable.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.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-vtable.rs:21:21
--> $DIR/collect-in-dead-vtable.rs:22: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:30:40
--> $DIR/collect-in-dead-vtable.rs:31:40
|
LL | let gen_vtable: &dyn MyTrait = &v; // vtable is "mentioned" here
| ^^

View File

@ -1,19 +1,19 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-vtable.rs:8:19
--> $DIR/collect-in-dead-vtable.rs:9:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:8:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.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-vtable.rs:21:21
--> $DIR/collect-in-dead-vtable.rs:22: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:30:40
--> $DIR/collect-in-dead-vtable.rs:31:40
|
LL | let gen_vtable: &dyn MyTrait = &v; // vtable is "mentioned" here
| ^^

View File

@ -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.

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/interpret-in-const-called-fn.rs:7:19
--> $DIR/interpret-in-const-called-fn.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:7:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-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/interpret-in-const-called-fn.rs:16:9
--> $DIR/interpret-in-const-called-fn.rs:17:9
|
LL | Fail::<T>::C;
| ^^^^^^^^^^^^

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/interpret-in-const-called-fn.rs:7:19
--> $DIR/interpret-in-const-called-fn.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:7:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-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/interpret-in-const-called-fn.rs:16:9
--> $DIR/interpret-in-const-called-fn.rs:17:9
|
LL | Fail::<T>::C;
| ^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
//@revisions: noopt opt
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! Make sure we error on erroneous consts even if they are unused.

View File

@ -6,18 +6,18 @@ error[E0080]: evaluation of constant value failed
note: inside `unreachable_unchecked`
--> $SRC_DIR/core/src/hint.rs:LL:COL
note: inside `ub`
--> $DIR/interpret-in-promoted.rs:6:5
--> $DIR/interpret-in-promoted.rs:7:5
|
LL | std::hint::unreachable_unchecked();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `FOO`
--> $DIR/interpret-in-promoted.rs:12:28
--> $DIR/interpret-in-promoted.rs:13:28
|
LL | let _x: &'static () = &ub();
| ^^^^
note: erroneous constant encountered
--> $DIR/interpret-in-promoted.rs:12:27
--> $DIR/interpret-in-promoted.rs:13:27
|
LL | let _x: &'static () = &ub();
| ^^^^^

View File

@ -6,18 +6,18 @@ error[E0080]: evaluation of constant value failed
note: inside `unreachable_unchecked`
--> $SRC_DIR/core/src/hint.rs:LL:COL
note: inside `ub`
--> $DIR/interpret-in-promoted.rs:6:5
--> $DIR/interpret-in-promoted.rs:7:5
|
LL | std::hint::unreachable_unchecked();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `FOO`
--> $DIR/interpret-in-promoted.rs:12:28
--> $DIR/interpret-in-promoted.rs:13:28
|
LL | let _x: &'static () = &ub();
| ^^^^
note: erroneous constant encountered
--> $DIR/interpret-in-promoted.rs:12:27
--> $DIR/interpret-in-promoted.rs:13:27
|
LL | let _x: &'static () = &ub();
| ^^^^^

View File

@ -1,4 +1,5 @@
//@revisions: noopt opt
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! Make sure we error on erroneous consts even if they are unused.

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/interpret-in-static.rs:7:19
--> $DIR/interpret-in-static.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:7:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.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/interpret-in-static.rs:15:9
--> $DIR/interpret-in-static.rs:16:9
|
LL | Fail::<i32>::C;
| ^^^^^^^^^^^^^^

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/interpret-in-static.rs:7:19
--> $DIR/interpret-in-static.rs:8:19
|
LL | const C: () = panic!();
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:7:19
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.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/interpret-in-static.rs:15:9
--> $DIR/interpret-in-static.rs:16:9
|
LL | Fail::<i32>::C;
| ^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
//@revisions: noopt opt
//@[noopt] compile-flags: -Copt-level=0
//@[opt] compile-flags: -O
//! Make sure we error on erroneous consts even if they are unused.