Add note on panic payload type.

This commit is contained in:
Mara Bos 2024-05-16 11:54:11 +02:00
parent ce0bc8bd58
commit 32bfe703e2

View file

@ -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