Skip to content

Commit 0d88b94

Browse files
authored
Rollup merge of #145303 - m-ou-se:payload-as-str-doc, r=jhpratt
Docs: Link to payload_as_str() from payload().
2 parents 8095423 + bd44d85 commit 0d88b94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/panic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl<'a> PanicHookInfo<'a> {
6060
/// Returns the payload associated with the panic.
6161
///
6262
/// This will commonly, but not always, be a `&'static str` or [`String`].
63+
/// If you only care about such payloads, use [`payload_as_str`] instead.
6364
///
6465
/// A invocation of the `panic!()` macro in Rust 2021 or later will always result in a
6566
/// panic payload of type `&'static str` or `String`.
@@ -69,6 +70,7 @@ impl<'a> PanicHookInfo<'a> {
6970
/// can result in a panic payload other than a `&'static str` or `String`.
7071
///
7172
/// [`String`]: ../../std/string/struct.String.html
73+
/// [`payload_as_str`]: PanicHookInfo::payload_as_str
7274
///
7375
/// # Examples
7476
///

0 commit comments

Comments
 (0)