Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call panic_display directly in const_panic_fmt. #116007

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/core/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ fn panic_in_cleanup() -> ! {
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
pub const fn const_panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
if let Some(msg) = fmt.as_str() {
panic_str(msg);
// The panic_display function is hooked by conost eval.
m-ou-se marked this conversation as resolved.
Show resolved Hide resolved
panic_display(&msg);
} else {
// SAFETY: This is only evaluated at compile time, which reliably
// handles this UB (in case this branch turns out to be reachable
Expand Down