Skip to content

Commit 682991d

Browse files
committed
explicitly set opt-level=0
1 parent 0d6a16a commit 682991d

File tree

43 files changed

+109
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+109
-94
lines changed

tests/ui/consts/required-consts/collect-in-called-fn.noopt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-called-fn.rs:9:19
2+
--> $DIR/collect-in-called-fn.rs:10:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:10: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: erroneous constant encountered
10-
--> $DIR/collect-in-called-fn.rs:18:17
10+
--> $DIR/collect-in-called-fn.rs:19:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn called::<i32>`
16-
--> $DIR/collect-in-called-fn.rs:23:5
16+
--> $DIR/collect-in-called-fn.rs:24:5
1717
|
1818
LL | called::<i32>();
1919
| ^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-called-fn.opt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-called-fn.rs:9:19
2+
--> $DIR/collect-in-called-fn.rs:10:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:10: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: erroneous constant encountered
10-
--> $DIR/collect-in-called-fn.rs:18:17
10+
--> $DIR/collect-in-called-fn.rs:19:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn called::<i32>`
16-
--> $DIR/collect-in-called-fn.rs:23:5
16+
--> $DIR/collect-in-called-fn.rs:24:5
1717
|
1818
LL | called::<i32>();
1919
| ^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-called-fn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is
56
//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090)

tests/ui/consts/required-consts/collect-in-dead-closure.noopt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-closure.rs:8:19
2+
--> $DIR/collect-in-dead-closure.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-closure.rs:16:17
10+
--> $DIR/collect-in-dead-closure.rs:17:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn not_called::<i32>`
16-
--> $DIR/collect-in-dead-closure.rs:23:33
16+
--> $DIR/collect-in-dead-closure.rs:24:33
1717
|
1818
LL | let _closure: fn() = || not_called::<T>();
1919
| ^^^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-closure.opt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-closure.rs:8:19
2+
--> $DIR/collect-in-dead-closure.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-closure.rs:16:17
10+
--> $DIR/collect-in-dead-closure.rs:17:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn not_called::<i32>`
16-
--> $DIR/collect-in-dead-closure.rs:23:33
16+
--> $DIR/collect-in-dead-closure.rs:24:33
1717
|
1818
LL | let _closure: fn() = || not_called::<T>();
1919
| ^^^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-closure.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56

tests/ui/consts/required-consts/collect-in-dead-drop.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/collect-in-dead-drop.rs:8:19
2+
--> $DIR/collect-in-dead-drop.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-drop.rs:15:17
10+
--> $DIR/collect-in-dead-drop.rs:16:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-drop.opt.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/collect-in-dead-drop.rs:8:19
2+
--> $DIR/collect-in-dead-drop.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-drop.rs:15:17
10+
--> $DIR/collect-in-dead-drop.rs:16:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56

tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.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/collect-in-dead-fn-behind-assoc-type.rs:9:19
2+
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:10: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:14:17
10+
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:15:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.opt.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/collect-in-dead-fn-behind-assoc-type.rs:9:19
2+
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:9:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:10: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:14:17
10+
--> $DIR/collect-in-dead-fn-behind-assoc-type.rs:15:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(impl_trait_in_assoc_type)]
22
//@revisions: noopt opt
33
//@ build-fail
4+
//@[noopt] compile-flags: -Copt-level=0
45
//@[opt] compile-flags: -O
56
//! This fails without optimizations, so it should also fail with optimizations.
67

tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.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/collect-in-dead-fn-behind-generic.rs:8:19
2+
--> $DIR/collect-in-dead-fn-behind-generic.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-generic.rs:13:17
10+
--> $DIR/collect-in-dead-fn-behind-generic.rs:14:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.opt.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/collect-in-dead-fn-behind-generic.rs:8:19
2+
--> $DIR/collect-in-dead-fn-behind-generic.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-generic.rs:13:17
10+
--> $DIR/collect-in-dead-fn-behind-generic.rs:14:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56

tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.noopt.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of `m::Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
2+
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:17:21
10+
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:18:21
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.opt.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of `m::Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
2+
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:10:23
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23
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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:17:21
10+
--> $DIR/collect-in-dead-fn-behind-opaque-type.rs:18:21
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56
#![feature(type_alias_impl_trait)]

tests/ui/consts/required-consts/collect-in-dead-fn.noopt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-fn.rs:8:19
2+
--> $DIR/collect-in-dead-fn.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn.rs:18:17
10+
--> $DIR/collect-in-dead-fn.rs:19:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn not_called::<i32>`
16-
--> $DIR/collect-in-dead-fn.rs:25:9
16+
--> $DIR/collect-in-dead-fn.rs:26:9
1717
|
1818
LL | not_called::<T>();
1919
| ^^^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn.opt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-fn.rs:8:19
2+
--> $DIR/collect-in-dead-fn.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fn.rs:18:17
10+
--> $DIR/collect-in-dead-fn.rs:19:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn not_called::<i32>`
16-
--> $DIR/collect-in-dead-fn.rs:25:9
16+
--> $DIR/collect-in-dead-fn.rs:26:9
1717
|
1818
LL | not_called::<T>();
1919
| ^^^^^^^^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56

tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.noopt.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of `Late::<i32>::FAIL` failed
2-
--> $DIR/collect-in-dead-fnptr-in-const.rs:8:22
2+
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:22
33
|
44
LL | const FAIL: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:8:22
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22
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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:28
10+
--> $DIR/collect-in-dead-fnptr-in-const.rs:10:28
1111
|
1212
LL | const FNPTR: fn() = || Self::FAIL;
1313
| ^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.opt.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of `Late::<i32>::FAIL` failed
2-
--> $DIR/collect-in-dead-fnptr-in-const.rs:8:22
2+
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:22
33
|
44
LL | const FAIL: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:8:22
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22
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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fnptr-in-const.rs:9:28
10+
--> $DIR/collect-in-dead-fnptr-in-const.rs:10:28
1111
|
1212
LL | const FNPTR: fn() = || Self::FAIL;
1313
| ^^^^^^^^^^

tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@revisions: noopt opt
22
//@ build-fail
3+
//@[noopt] compile-flags: -Copt-level=0
34
//@[opt] compile-flags: -O
45
//! This fails without optimizations, so it should also fail with optimizations.
56

tests/ui/consts/required-consts/collect-in-dead-fnptr.noopt.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error[E0080]: evaluation of `Fail::<i32>::C` failed
2-
--> $DIR/collect-in-dead-fnptr.rs:8:19
2+
--> $DIR/collect-in-dead-fnptr.rs:9:19
33
|
44
LL | const C: () = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:8:19
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:9: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: erroneous constant encountered
10-
--> $DIR/collect-in-dead-fnptr.rs:17:17
10+
--> $DIR/collect-in-dead-fnptr.rs:18:17
1111
|
1212
LL | let _ = Fail::<T>::C;
1313
| ^^^^^^^^^^^^
1414

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

0 commit comments

Comments
 (0)