Skip to content

Commit bd44d85

Browse files
committed
Link to payload_as_str() from payload().
1 parent a153133 commit bd44d85

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)