Add note on panic payload type. · model-checking/verify-rust-std@ad0667f (original) (raw)

Original file line number Diff line number Diff line change
@@ -63,6 +63,13 @@ impl<'a> PanicHookInfo<'a> {
63 63 ///
64 64 /// This will commonly, but not always, be a `&'static str` or [`String`].
65 65 ///
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 + ///
66 73 /// [`String`]: ../../std/string/struct.String.html
67 74 ///
68 75 /// # Examples