Skip to content

Commit 1b5ef5c

Browse files
committed
const-eval error: always say in which item the error occurred
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
1 parent b771b4b commit 1b5ef5c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/fail/const-ub-checks.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: accessing memory based on pointer with alignment ALIGN, but alignm
22
--> tests/fail/const-ub-checks.rs:LL:CC
33
|
44
LL | ptr.read();
5-
| ^^^^^^^^^^ evaluation of constant value failed here
5+
| ^^^^^^^^^^ evaluation of `UNALIGNED_READ` failed here
66

77
note: erroneous constant encountered
88
--> tests/fail/const-ub-checks.rs:LL:CC

tests/fail/erroneous_const2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: attempt to compute `5_u32 - 6_u32`, which would overflow
22
--> tests/fail/erroneous_const2.rs:LL:CC
33
|
44
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5-
| ^^^^^ evaluation of constant value failed here
5+
| ^^^^^ evaluation of `FOO` failed here
66

77
note: erroneous constant encountered
88
--> tests/fail/erroneous_const2.rs:LL:CC

0 commit comments

Comments
 (0)