Skip to content

Commit d6c5efd

Browse files
committed
Shorten span of panic failures in const context
Previously, we included a redundant prefix on the panic message and a postfix of the location of the panic. The prefix didn't carry any additional information beyond "something failed", and the location of the panic is redundant with the diagnostic's span, which gets printed out even if its code is not shown. ``` error[E0080]: evaluation of constant value failed --> $DIR/assert-type-intrinsics.rs:11:9 | LL | MaybeUninit::<!>::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` ``` ``` --> $DIR/collect-in-dead-closure.rs:9:19 | LL | const C: () = panic!(); | ^^^^^^^^ explicit panic | = 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) ``` ``` error[E0080]: evaluation of constant value failed --> $DIR/uninhabited.rs:87:9 | LL | assert!(false); | ^^^^^^^^^^^^^^ assertion failed: false | = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) ```
1 parent affdb59 commit d6c5efd

File tree

65 files changed

+98
-102
lines changed

Some content is hidden

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

65 files changed

+98
-102
lines changed

compiler/rustc_const_eval/messages.ftl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ const_eval_overflow_arith =
300300
const_eval_overflow_shift =
301301
overflowing shift by {$shift_amount} in `{$intrinsic}`
302302
303-
const_eval_panic =
304-
the evaluated program panicked at '{$msg}', {$file}:{$line}:{$col}
303+
const_eval_panic = {$msg}
305304
306305
const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str`
307306

compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ impl MachineStopType for ConstEvalErrKind {
4848
| ModifiedGlobal
4949
| WriteThroughImmutablePointer => {}
5050
AssertFailure(kind) => kind.add_args(adder),
51-
Panic { msg, line, col, file } => {
51+
Panic { msg, .. } => {
5252
adder("msg".into(), msg.into_diag_arg());
53-
adder("file".into(), file.into_diag_arg());
54-
adder("line".into(), line.into_diag_arg());
55-
adder("col".into(), col.into_diag_arg());
5653
}
5754
}
5855
}

src/tools/miri/tests/fail/erroneous_const.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
22
--> tests/fail/erroneous_const.rs:LL:CC
33
|
44
LL | const VOID: ! = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', tests/fail/erroneous_const.rs:LL:CC
5+
| ^^^^^^^^ explicit panic
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

tests/ui/borrowck/issue-81899.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-81899.rs:11:5
33
|
44
LL | panic!()
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:11:5
5+
| ^^^^^^^^ explicit panic
66
|
77
note: inside `f::<{closure@$DIR/issue-81899.rs:4:31: 4:34}>`
88
--> $DIR/issue-81899.rs:11:5

tests/ui/borrowck/issue-88434-minimal-example.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-88434-minimal-example.rs:10:5
33
|
44
LL | panic!()
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:10:5
5+
| ^^^^^^^^ explicit panic
66
|
77
note: inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28}>`
88
--> $DIR/issue-88434-minimal-example.rs:10:5

tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
33
|
44
LL | panic!()
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:10:5
5+
| ^^^^^^^^ explicit panic
66
|
77
note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
88
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5

tests/ui/coherence/const-errs-dont-conflict-103369.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
33
|
44
LL | panic!("Some error occurred");
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some error occurred
66
|
77
note: inside `my_fn`
88
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
@@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
2020
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
2121
|
2222
LL | panic!("Some error occurred");
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'Some error occurred', $DIR/const-errs-dont-conflict-103369.rs:10:5
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some error occurred
2424
|
2525
note: inside `my_fn`
2626
--> $DIR/const-errs-dont-conflict-103369.rs:10:5

tests/ui/const-ptr/forbidden_slices.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }
102102
error[E0080]: could not evaluate static initializer
103103
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
104104
|
105-
= note: the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
105+
= note: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
106106
|
107107
note: inside `std::ptr::const_ptr::<impl *const ()>::sub_ptr`
108108
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL

tests/ui/consts/assert-type-intrinsics.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/assert-type-intrinsics.rs:11:9
33
|
44
LL | MaybeUninit::<!>::uninit().assume_init();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'aborted execution: attempted to instantiate uninhabited type `!`', $DIR/assert-type-intrinsics.rs:11:36
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
66

77
error[E0080]: evaluation of constant value failed
88
--> $DIR/assert-type-intrinsics.rs:15:9
99
|
1010
LL | intrinsics::assert_mem_uninitialized_valid::<&'static i32>();
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'aborted execution: attempted to leave type `&i32` uninitialized, which is invalid', $DIR/assert-type-intrinsics.rs:15:9
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `&i32` uninitialized, which is invalid
1212

1313
error[E0080]: evaluation of constant value failed
1414
--> $DIR/assert-type-intrinsics.rs:19:9
1515
|
1616
LL | intrinsics::assert_zero_valid::<&'static i32>();
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'aborted execution: attempted to zero-initialize type `&i32`, which is invalid', $DIR/assert-type-intrinsics.rs:19:9
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
1818

1919
error: aborting due to 3 previous errors
2020

tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic-normalize-tabs-115498.rs:3:17
33
|
44
LL | struct Bug([u8; panic!{"\t"}]);
5-
| ^^^^^^^^^^^^ the evaluated program panicked at ' ', $DIR/const_panic-normalize-tabs-115498.rs:3:17
5+
| ^^^^^^^^^^^^
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/const-eval/const_panic.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,95 +2,95 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic.rs:6:15
33
|
44
LL | const Z: () = std::panic!("cheese");
5-
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic.rs:6:15
5+
| ^^^^^^^^^^^^^^^^^^^^^ cheese
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic.rs:9:16
1111
|
1212
LL | const Z2: () = std::panic!();
13-
| ^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic.rs:9:16
13+
| ^^^^^^^^^^^^^ explicit panic
1414
|
1515
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic.rs:12:15
1919
|
2020
LL | const Y: () = std::unreachable!();
21-
| ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:12:15
21+
| ^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
2222
|
2323
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

2525
error[E0080]: evaluation of constant value failed
2626
--> $DIR/const_panic.rs:15:15
2727
|
2828
LL | const X: () = std::unimplemented!();
29-
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:15:15
29+
| ^^^^^^^^^^^^^^^^^^^^^ not implemented
3030
|
3131
= note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
3232

3333
error[E0080]: evaluation of constant value failed
3434
--> $DIR/const_panic.rs:18:15
3535
|
3636
LL | const W: () = std::panic!(MSG);
37-
| ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:18:15
37+
| ^^^^^^^^^^^^^^^^ hello
3838
|
3939
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4040

4141
error[E0080]: evaluation of constant value failed
4242
--> $DIR/const_panic.rs:21:16
4343
|
4444
LL | const W2: () = std::panic!("{}", MSG);
45-
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:21:16
45+
| ^^^^^^^^^^^^^^^^^^^^^^ hello
4646
|
4747
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4848

4949
error[E0080]: evaluation of constant value failed
5050
--> $DIR/const_panic.rs:24:20
5151
|
5252
LL | const Z_CORE: () = core::panic!("cheese");
53-
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic.rs:24:20
53+
| ^^^^^^^^^^^^^^^^^^^^^^ cheese
5454
|
5555
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
5656

5757
error[E0080]: evaluation of constant value failed
5858
--> $DIR/const_panic.rs:27:21
5959
|
6060
LL | const Z2_CORE: () = core::panic!();
61-
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic.rs:27:21
61+
| ^^^^^^^^^^^^^^ explicit panic
6262
|
6363
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
6464

6565
error[E0080]: evaluation of constant value failed
6666
--> $DIR/const_panic.rs:30:20
6767
|
6868
LL | const Y_CORE: () = core::unreachable!();
69-
| ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:30:20
69+
| ^^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
7070
|
7171
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
7272

7373
error[E0080]: evaluation of constant value failed
7474
--> $DIR/const_panic.rs:33:20
7575
|
7676
LL | const X_CORE: () = core::unimplemented!();
77-
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:33:20
77+
| ^^^^^^^^^^^^^^^^^^^^^^ not implemented
7878
|
7979
= note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
8080

8181
error[E0080]: evaluation of constant value failed
8282
--> $DIR/const_panic.rs:36:20
8383
|
8484
LL | const W_CORE: () = core::panic!(MSG);
85-
| ^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:36:20
85+
| ^^^^^^^^^^^^^^^^^ hello
8686
|
8787
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
8888

8989
error[E0080]: evaluation of constant value failed
9090
--> $DIR/const_panic.rs:39:21
9191
|
9292
LL | const W2_CORE: () = core::panic!("{}", MSG);
93-
| ^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic.rs:39:21
93+
| ^^^^^^^^^^^^^^^^^^^^^^^ hello
9494
|
9595
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
9696

tests/ui/consts/const-eval/const_panic_2021.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,79 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_2021.rs:6:15
33
|
44
LL | const A: () = std::panic!("blåhaj");
5-
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'blåhaj', $DIR/const_panic_2021.rs:6:15
5+
| ^^^^^^^^^^^^^^^^^^^^^ blåhaj
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic_2021.rs:9:15
1111
|
1212
LL | const B: () = std::panic!();
13-
| ^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:9:15
13+
| ^^^^^^^^^^^^^ explicit panic
1414
|
1515
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic_2021.rs:12:15
1919
|
2020
LL | const C: () = std::unreachable!();
21-
| ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:12:15
21+
| ^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
2222
|
2323
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

2525
error[E0080]: evaluation of constant value failed
2626
--> $DIR/const_panic_2021.rs:15:15
2727
|
2828
LL | const D: () = std::unimplemented!();
29-
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:15:15
29+
| ^^^^^^^^^^^^^^^^^^^^^ not implemented
3030
|
3131
= note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
3232

3333
error[E0080]: evaluation of constant value failed
3434
--> $DIR/const_panic_2021.rs:18:15
3535
|
3636
LL | const E: () = std::panic!("{}", MSG);
37-
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic_2021.rs:18:15
37+
| ^^^^^^^^^^^^^^^^^^^^^^ hello
3838
|
3939
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4040

4141
error[E0080]: evaluation of constant value failed
4242
--> $DIR/const_panic_2021.rs:21:20
4343
|
4444
LL | const A_CORE: () = core::panic!("shark");
45-
| ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'shark', $DIR/const_panic_2021.rs:21:20
45+
| ^^^^^^^^^^^^^^^^^^^^^ shark
4646
|
4747
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4848

4949
error[E0080]: evaluation of constant value failed
5050
--> $DIR/const_panic_2021.rs:24:20
5151
|
5252
LL | const B_CORE: () = core::panic!();
53-
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:24:20
53+
| ^^^^^^^^^^^^^^ explicit panic
5454
|
5555
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
5656

5757
error[E0080]: evaluation of constant value failed
5858
--> $DIR/const_panic_2021.rs:27:20
5959
|
6060
LL | const C_CORE: () = core::unreachable!();
61-
| ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:27:20
61+
| ^^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
6262
|
6363
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
6464

6565
error[E0080]: evaluation of constant value failed
6666
--> $DIR/const_panic_2021.rs:30:20
6767
|
6868
LL | const D_CORE: () = core::unimplemented!();
69-
| ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:30:20
69+
| ^^^^^^^^^^^^^^^^^^^^^^ not implemented
7070
|
7171
= note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
7272

7373
error[E0080]: evaluation of constant value failed
7474
--> $DIR/const_panic_2021.rs:33:20
7575
|
7676
LL | const E_CORE: () = core::panic!("{}", MSG);
77-
| ^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'hello', $DIR/const_panic_2021.rs:33:20
77+
| ^^^^^^^^^^^^^^^^^^^^^^^ hello
7878
|
7979
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
8080

tests/ui/consts/const-eval/const_panic_libcore_bin.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_libcore_bin.rs:8:15
33
|
44
LL | const Z: () = panic!("cheese");
5-
| ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_bin.rs:8:15
5+
| ^^^^^^^^^^^^^^^^ cheese
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
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic_libcore_bin.rs:11:15
1111
|
1212
LL | const Y: () = unreachable!();
13-
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_bin.rs:11:15
13+
| ^^^^^^^^^^^^^^ internal error: entered unreachable code
1414
|
1515
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic_libcore_bin.rs:14:15
1919
|
2020
LL | const X: () = unimplemented!();
21-
| ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_libcore_bin.rs:14:15
21+
| ^^^^^^^^^^^^^^^^ not implemented
2222
|
2323
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

tests/ui/consts/const-eval/const_panic_track_caller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const fn b() -> u32 {
1414
const fn c() -> u32 {
1515
b()
1616
//~^ ERROR evaluation of constant value failed
17-
//~| NOTE the evaluated program panicked
17+
//~| NOTE hey
1818
//~| NOTE inside
1919
}
2020

tests/ui/consts/const-eval/const_panic_track_caller.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_track_caller.rs:15:5
33
|
44
LL | b()
5-
| ^^^ the evaluated program panicked at 'hey', $DIR/const_panic_track_caller.rs:15:5
5+
| ^^^ hey
66
|
77
note: inside `c`
88
--> $DIR/const_panic_track_caller.rs:15:5

tests/ui/consts/const-eval/panic-assoc-never-type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/panic-assoc-never-type.rs:9:21
33
|
44
LL | const VOID: ! = panic!();
5-
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:9:21
5+
| ^^^^^^^^ explicit panic
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

0 commit comments

Comments
 (0)