Skip to content

Commit d5e45b5

Browse files
committed
Incorporate review feedback #2
1 parent 61e5d54 commit d5e45b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/core/src/macros/panic.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ When using `panic!()` you can specify a string payload, that is built using
1313
the [`format!`] syntax. That payload is used when injecting the panic into
1414
the calling Rust thread, causing the thread to panic entirely.
1515

16-
The default `std` panic handling strategy is to print the message payload to
17-
the `stderr` along with the file/line/column information of the `panic!()`
16+
The behavior of the default `std` hook, i.e. the code, that runs directy
17+
after the panic is invoked, is to print the message payload to the
18+
`stderr` along with the file/line/column information of the `panic!()`
1819
call. You can override the panic hook using [`std::panic::set_hook()`].
19-
Inside the hook a panic can be reaped as the [`Box`]`<`[`Any`]`>` type,
20+
Inside the hook a panic can be accessed as a `&dyn Any + Send`, which
2021
which contains either a `&str` or `String` for regular `panic!()` invocations.
2122
To panic with a value of another other type, [`panic_any`] can be used.
2223

0 commit comments

Comments
 (0)