catch_unwind docs are unclear about panic hook #122464
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Location
std::panic::catch_unwind
Summary
The docs for std::panic::catch_unwind notes section:
The second paragraph says "if a custom panic hook has been set". This implies a simple program like the following will not print a panic message, but it does:
This is the default hook, there is no need to set a custom one.
The text could be changed to something like "if a panic hook is set", as well as further discussion of the panic hook, which is covered in the
panic!
docs, but none of the docs forpanic!
,set_hook
, ortake_hook
mentioncatch_unwind
. There's no discussion in the parentpanic
module.In typical usage
catch_unwind
will involveset_hook
andtake_hook
, so the docs should cover this.The text was updated successfully, but these errors were encountered: