Closed
Description
#44489 was closed when #51366 stabilized the corresponding language feature, but we didn’t realize that it was also the tracking issue for this standard library feature:
// In `core::panic`:
impl PanicInfo<'_> {
/// The message that was given to the `panic!` macro.
pub fn message(&self) -> PanicMessage<'_>;
}
// Opaque type that wraps a fmt::Arguments<'a>.
pub struct PanicMessage<'a> { .. }
impl Display for PanicMessage<'_>;
impl Debug for PanicMessage<'_>;
impl PanicMessage<'_> {
pub fn as_str(&self) -> Option<&'static str>;
}
History:
- Original tracking issue: Tracking issue for RFC 2070: stable mechanism to specify the behavior of panic! in no-std applications #44489
- Discussion of payload vs message Tracking issue for PanicInfo::message #66745 (comment)
- Making .message() infallible: Make
PanicInfo::message
infallible #115561 - Split core/std PanicInfo into two types: Split core's PanicInfo and std's PanicInfo #115974
- This made core::panic::PanicInfo::message() infallible.
- Use opaque return type: Return opaque type from PanicInfo::message() #126330
- FCP
- Stablization PR: Stabilize
PanicInfo::message()
andPanicMessage
#126732
Unresolved questions:
- Should it be infallible?
- Yes, by making std::panic::PanicHookInfo a different type.
- What should the return type be?
fmt::Arguments
or an opaquePanicMessage
? The first is simpler, but the latter allows a bit more flexibility for future changes.
Metadata
Metadata
Assignees
Labels
Area: Error handlingBlocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Project group: Error handling (https://github.com/rust-lang/project-error-handling)Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.