Skip to content

Commit ad0667f

Browse files
committed
Add note on panic payload type.
1 parent 518722e commit ad0667f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

std/src/panic.rs

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ impl<'a> PanicHookInfo<'a> {
6363
///
6464
/// This will commonly, but not always, be a `&'static str` or [`String`].
6565
///
66+
/// A invocation of the `panic!()` macro in Rust 2021 or later will always result in a
67+
/// panic payload of type `&'static str` or `String`.
68+
///
69+
/// Only an invocation of [`panic_any`]
70+
/// (or, in Rust 2018 and earlier, `panic!(x)` where `x` is something other than a string)
71+
/// can result in a panic payload other than a `&'static str` or `String`.
72+
///
6673
/// [`String`]: ../../std/string/struct.String.html
6774
///
6875
/// # Examples

0 commit comments

Comments
 (0)