Skip to content

Commit

Permalink
Add note on panic payload type.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Jun 11, 2024
1 parent 518722e commit ad0667f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions std/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ impl<'a> PanicHookInfo<'a> {
///
/// This will commonly, but not always, be a `&'static str` or [`String`].
///
/// A invocation of the `panic!()` macro in Rust 2021 or later will always result in a
/// panic payload of type `&'static str` or `String`.
///
/// Only an invocation of [`panic_any`]
/// (or, in Rust 2018 and earlier, `panic!(x)` where `x` is something other than a string)
/// can result in a panic payload other than a `&'static str` or `String`.
///
/// [`String`]: ../../std/string/struct.String.html
///
/// # Examples
Expand Down

0 comments on commit ad0667f

Please sign in to comment.