Skip to content

Commit 9d5d183

Browse files
committed
Clarify why we are talking about a failed const eval at a random place
1 parent 8ec0bd2 commit 9d5d183

File tree

216 files changed

+971
-971
lines changed

Some content is hidden

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

216 files changed

+971
-971
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

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

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 panicked: explicit panic
22
--> $DIR/issue-81899.rs:6:24
33
|
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
5-
| ^^^^^^^^^^^^^^ evaluation of constant value failed
5+
| ^^^^^^^^^^^^^^ evaluation of constant value failed here
66
|
77
note: inside `f::<{closure@$DIR/issue-81899.rs:6:31: 6:34}>`
88
--> $DIR/issue-81899.rs:13: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 panicked: explicit panic
22
--> $DIR/issue-88434-minimal-example.rs:5:22
33
|
44
LL | const _CONST: &() = &f(&|_| {});
5-
| ^^^^^^^^^^ evaluation of constant value failed
5+
| ^^^^^^^^^^ evaluation of constant value failed here
66
|
77
note: inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:5:25: 5:28}>`
88
--> $DIR/issue-88434-minimal-example.rs:12: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 panicked: explicit panic
22
--> $DIR/issue-88434-removal-index-should-be-less.rs:5:24
33
|
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
5-
| ^^^^^^^^^^^^^^ evaluation of constant value failed
5+
| ^^^^^^^^^^^^^^ evaluation of constant value failed here
66
|
77
note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:5:31: 5:34}>`
88
--> $DIR/issue-88434-removal-index-should-be-less.rs:12:5

0 commit comments

Comments
 (0)