Skip to content

Commit 16201da

Browse files
committed
Rename panic_box to panic_any.
1 parent 01b0aff commit 16201da

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

library/std/src/panic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ pub use crate::panicking::{set_hook, take_hook};
2323
#[stable(feature = "panic_hooks", since = "1.10.0")]
2424
pub use core::panic::{Location, PanicInfo};
2525

26-
/// Panic the current thread, with the given payload as the panic message.
26+
/// Panic the current thread with the given message as the panic payload.
2727
///
28-
/// This supports an arbitrary panic payload, instead of just (formatted) strings.
28+
/// The message can be of any (`Any + Send`) type, not just strings.
2929
///
30-
/// The message is attached as a `Box<'static + Any + Send>`, which can be
31-
/// accessed using [`PanicInfo::payload`].
30+
/// The message is wrapped in a `Box<'static + Any + Send>`, which can be
31+
/// accessed later using [`PanicInfo::payload`].
3232
///
3333
/// See the [`panic!`] macro for more information about panicking.
3434
#[unstable(feature = "panic_box", issue = "none")]
3535
#[inline]
36-
pub fn panic_box<M: Any + Send>(msg: M) -> ! {
36+
pub fn panic_any<M: Any + Send>(msg: M) -> ! {
3737
crate::panicking::begin_panic(msg);
3838
}
3939

0 commit comments

Comments
 (0)