Skip to content

Commit b440ded

Browse files
committed
Auto merge of #142008 - RalfJung:const-eval-error-here, r=oli-obk
const-eval error: always say in which item the error occurred I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const. r? `@oli-obk`
2 parents d18b380 + 1b5ef5c commit b440ded

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)