Skip to content

Commit 0046bab

Browse files
committed
review comment: reword message and add detail to tests
1 parent 0c1d5b4 commit 0046bab

File tree

50 files changed

+154
-141
lines changed

Some content is hidden

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

50 files changed

+154
-141
lines changed

compiler/rustc_const_eval/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ const_eval_frame_note = {$times ->
104104
}
105105
106106
const_eval_frame_note_inner = {$is_last ->
107-
[true] {"the evaluated program failed "}
107+
[true] {"the failure occurred "}
108108
*[false] {""}
109109
}inside {$where_ ->
110110
[closure] closure
111111
[instance] `{$instance}`
112112
*[other] {""}
113113
}
114114
115-
const_eval_frame_note_last = the evaluated program failed here
115+
const_eval_frame_note_last = the failure occurred here
116116
117117
const_eval_in_bounds_test = out-of-bounds pointer use
118118
const_eval_incompatible_calling_conventions =

tests/ui/borrowck/issue-81899.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fn f<F>(_: &[u8], _: F) -> &[u8]
88
where
99
F: FnMut(&u8),
1010
{
11-
panic!() //~ panic
11+
panic!() //~ inside `f
1212
}
1313

1414
fn main() {}

tests/ui/borrowck/issue-81899.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0080]: evaluation of constant value failed
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
55
| ^^^^^^^^^^^^^^ panic: explicit panic
66
|
7-
note: the evaluated program failed inside `f::<{closure@$DIR/issue-81899.rs:4:31: 4:34}>`
7+
note: the failure occurred inside `f::<{closure@$DIR/issue-81899.rs:4:31: 4:34}>`
88
--> $DIR/issue-81899.rs:11:5
99
|
1010
LL | panic!()
11-
| ^^^^^^^^ the evaluated program failed here
11+
| ^^^^^^^^ the failure occurred here
1212
= 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)
1313

1414
note: erroneous constant encountered

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fn f<F>(_: &F)
77
where
88
F: FnMut(&u8),
99
{
10-
panic!() //~ panic
10+
panic!() //~ inside `f
1111
}
1212

1313
fn main() { }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0080]: evaluation of constant value failed
44
LL | const _CONST: &() = &f(&|_| {});
55
| ^^^^^^^^^^ panic: explicit panic
66
|
7-
note: the evaluated program failed inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28}>`
7+
note: the failure occurred inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28}>`
88
--> $DIR/issue-88434-minimal-example.rs:10:5
99
|
1010
LL | panic!()
11-
| ^^^^^^^^ the evaluated program failed here
11+
| ^^^^^^^^ the failure occurred here
1212
= 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)
1313

1414
note: erroneous constant encountered

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fn f<F>(_: &[u8], _: F) -> &[u8]
77
where
88
F: FnMut(&u8),
99
{
10-
panic!() //~ panic
10+
panic!() //~ inside `f
1111
}
1212

1313
fn main() { }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0080]: evaluation of constant value failed
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
55
| ^^^^^^^^^^^^^^ panic: explicit panic
66
|
7-
note: the evaluated program failed inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
7+
note: the failure occurred 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
99
|
1010
LL | panic!()
11-
| ^^^^^^^^ the evaluated program failed here
11+
| ^^^^^^^^ the failure occurred here
1212
= 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)
1313

1414
note: erroneous constant encountered

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0080]: evaluation of constant value failed
44
LL | impl ConstGenericTrait<{my_fn(1)}> for () {}
55
| ^^^^^^^^ panic: Some error occurred
66
|
7-
note: the evaluated program failed inside `my_fn`
7+
note: the failure occurred inside `my_fn`
88
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
99
|
1010
LL | panic!("Some error occurred");
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program failed here
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
1212
= 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)
1313

1414
error[E0080]: evaluation of constant value failed
@@ -17,11 +17,11 @@ error[E0080]: evaluation of constant value failed
1717
LL | impl ConstGenericTrait<{my_fn(2)}> for () {}
1818
| ^^^^^^^^ panic: Some error occurred
1919
|
20-
note: the evaluated program failed inside `my_fn`
20+
note: the failure occurred inside `my_fn`
2121
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
2222
|
2323
LL | panic!("Some error occurred");
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program failed here
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
2525
= 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)
2626

2727
error: aborting due to 2 previous errors

tests/ui/const-generics/issues/issue-100313.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct T<const B: &'static bool>;
66
impl<const B: &'static bool> T<B> {
77
const fn set_false(&self) {
88
unsafe {
9-
*(B as *const bool as *mut bool) = false;
9+
*(B as *const bool as *mut bool) = false; //~ inside `T
1010
}
1111
}
1212
}

tests/ui/const-generics/issues/issue-100313.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ error[E0080]: evaluation of constant value failed
44
LL | x.set_false();
55
| ^^^^^^^^^^^^^ writing to ALLOC0 which is read-only
66
|
7-
note: the evaluated program failed inside `T::<&true>::set_false`
7+
note: the failure occurred inside `T::<&true>::set_false`
88
--> $DIR/issue-100313.rs:9:13
99
|
1010
LL | *(B as *const bool as *mut bool) = false;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program failed here
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
1212

1313
error: aborting due to 1 previous error
1414

0 commit comments

Comments
 (0)