Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a6e43ad

Browse files
committedFeb 25, 2025·
Remove special casing of const panic label
1 parent ef8f4d8 commit a6e43ad

File tree

62 files changed

+97
-107
lines changed

Some content is hidden

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

62 files changed

+97
-107
lines changed
 

‎compiler/rustc_const_eval/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const_eval_overflow_arith =
302302
const_eval_overflow_shift =
303303
overflowing shift by {$shift_amount} in `{$intrinsic}`
304304
305-
const_eval_panic = panic: {$msg}
305+
const_eval_panic = evaluation panicked: {$msg}
306306
307307
const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str`
308308

‎compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,7 @@ impl MachineStopType for ConstEvalErrKind {
3434
match self {
3535
ConstAccessesMutGlobal => const_eval_const_accesses_mut_global,
3636
ModifiedGlobal => const_eval_modified_global,
37-
Panic { msg, .. } => {
38-
let msg = msg.as_str();
39-
match msg {
40-
"explicit panic"
41-
| "not implemented"
42-
| "not yet implemented"
43-
| "internal error: entered unreachable code" => msg.to_string().into(),
44-
_ if msg.starts_with("assertion failed: ") => msg.to_string().into(),
45-
_ => const_eval_panic,
46-
}
47-
}
37+
Panic { .. } => const_eval_panic,
4838
RecursiveStatic => const_eval_recursive_static,
4939
AssertFailure(x) => x.diagnostic_message(),
5040
WriteThroughImmutablePointer => const_eval_write_through_immutable_pointer,

0 commit comments

Comments
 (0)
Please sign in to comment.