Skip to content

Commit 020216c

Browse files
committed
Clarify why we are talking about a failed const eval at a random place
1 parent b331b8b commit 020216c

File tree

219 files changed

+974
-974
lines changed

Some content is hidden

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

219 files changed

+974
-974
lines changed

compiler/rustc_const_eval/messages.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ const_eval_dyn_call_not_a_method =
8989
`dyn` call trying to call something that is not a method
9090
9191
const_eval_error = {$error_kind ->
92-
[static] could not evaluate static initializer
93-
[const] evaluation of constant value failed
94-
[const_with_path] evaluation of `{$instance}` failed
92+
[static] evaluation of static initializer failed here
93+
[const] evaluation of constant value failed here
94+
[const_with_path] evaluation of `{$instance}` failed here
9595
*[other] {""}
9696
}
9797

src/tools/clippy/tests/ui/indexing_slicing_index.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0080]: index out of bounds: the length is 2 but the index is 4
1313
--> tests/ui/indexing_slicing_index.rs:69:14
1414
|
1515
LL | const { &ARR[idx4()] };
16-
| ^^^^^^^^^^^ evaluation of `main::{constant#3}` failed
16+
| ^^^^^^^^^^^ evaluation of `main::{constant#3}` failed here
1717

1818
note: erroneous constant encountered
1919
--> tests/ui/indexing_slicing_index.rs:69:5

src/tools/miri/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
5+
| ^^^^^^^^^^ evaluation of constant value failed here
66

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

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 panicked: explicit panic
22
--> tests/fail/erroneous_const.rs:LL:CC
33
|
44
LL | const VOID: ! = panic!();
5-
| ^^^^^^^^ evaluation of `PrintName::<i32>::VOID` failed
5+
| ^^^^^^^^ evaluation of `PrintName::<i32>::VOID` failed here
66

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

src/tools/miri/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
5+
| ^^^^^ evaluation of constant value failed here
66

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

tests/rustdoc-ui/const-evalutation-ice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: attempt to compute `0_usize - 1_usize`, which would overflow
22
--> $DIR/const-evalutation-ice.rs:10:22
33
|
44
LL | pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of constant value failed
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of constant value failed here
66

77
error: aborting due to 1 previous error
88

tests/ui/array-slice-vec/array_const_index-0.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: index out of bounds: the length is 0 but the index is 1
22
--> $DIR/array_const_index-0.rs:2:16
33
|
44
LL | const B: i32 = (&A)[1];
5-
| ^^^^^^^ evaluation of constant value failed
5+
| ^^^^^^^ evaluation of constant value failed here
66

77
error: aborting due to 1 previous error
88

tests/ui/array-slice-vec/array_const_index-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: index out of bounds: the length is 0 but the index is 1
22
--> $DIR/array_const_index-1.rs:2:16
33
|
44
LL | const B: i32 = A[1];
5-
| ^^^^ evaluation of constant value failed
5+
| ^^^^ evaluation of constant value failed here
66

77
error: aborting due to 1 previous error
88

tests/ui/asm/fail-const-eval-issue-121099.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ error[E0080]: attempt to shift left by `500_i32`, which would overflow
22
--> $DIR/fail-const-eval-issue-121099.rs:8:31
33
|
44
LL | global_asm!("/* {} */", const 1 << 500);
5-
| ^^^^^^^^ evaluation of `{global_asm#0}::{constant#0}` failed
5+
| ^^^^^^^^ evaluation of `{global_asm#0}::{constant#0}` failed here
66

77
error[E0080]: attempt to divide `1_i32` by zero
88
--> $DIR/fail-const-eval-issue-121099.rs:10:31
99
|
1010
LL | global_asm!("/* {} */", const 1 / 0);
11-
| ^^^^^ evaluation of `{global_asm#1}::{constant#0}` failed
11+
| ^^^^^ evaluation of `{global_asm#1}::{constant#0}` failed here
1212

1313
error: aborting due to 2 previous errors
1414

tests/ui/associated-consts/defaults-not-assumed-fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: attempt to compute `u8::MAX + 1_u8`, which would overflow
22
--> $DIR/defaults-not-assumed-fail.rs:9:19
33
|
44
LL | const B: u8 = Self::A + 1;
5-
| ^^^^^^^^^^^ evaluation of `<() as Tr>::B` failed
5+
| ^^^^^^^^^^^ evaluation of `<() as Tr>::B` failed here
66

77
note: erroneous constant encountered
88
--> $DIR/defaults-not-assumed-fail.rs:34:16

0 commit comments

Comments
 (0)