-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-error-handlingArea: Error handlingArea: Error handlingA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Feature gate: #![feature(panic_any)]
This is a tracking issue for std::panic::panic_any
, a function to allow panicking with any value.
Context
Right now, it is possible to panic (that is, std::panic!
) on any value: panic!(123)
. This will be disallowed in Rust 2021, when panic!(..)
will always take a format string just like println!(..)
. At that point, this function will be the only way to panic without a (format) string. (See #80162 and rust-lang/rfcs#3007.)
Public API
mod std::panic {
/// Panic the current thread with the given message as the panic payload.
///
/// The message can be of any (`Any + Send`) type, not just strings.
///
/// The message is wrapped in a `Box<'static + Any + Send>`, which can be
/// accessed later using [`PanicInfo::payload`].
///
/// See the [`panic!`] macro for more information about panicking.
pub fn panic_any<M: Any + Send>(msg: M) -> !;
}
Steps / History
- Implementation: Add std::panic::panic_any. #74622
- Final commenting period (FCP)
- Stabilization PR: Stabilize std::panic::panic_any. #81194
Unresolved Questions
- None yet.
Metadata
Metadata
Assignees
Labels
A-error-handlingArea: Error handlingArea: Error handlingA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.