about summary refs log tree commit diff
path: root/library/core/src/panic
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2023-09-26 14:40:36 +0200
committerMara Bos <m-ou.se@m-ou.se>2024-06-11 15:46:59 +0200
commita519dc85f8aa1348ec9cdc46906bbcbb9d115981 (patch)
treec176c5e9d45fbd73c2ddd1344377f13f8e297d19 /library/core/src/panic
parente3e815370e824a9d7e74024da54acbe5ac477786 (diff)
Document difference between core and std's PanicInfo.
Diffstat (limited to 'library/core/src/panic')
-rw-r--r--library/core/src/panic/panic_info.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs
index 2b7bc76fbc2..6a600e2d431 100644
--- a/library/core/src/panic/panic_info.rs
+++ b/library/core/src/panic/panic_info.rs
@@ -4,6 +4,15 @@ use crate::panic::Location;
 /// A struct providing information about a panic.
 ///
 /// A `PanicInfo` structure is passed to the panic handler defined by `#[panic_handler]`.
+///
+/// There two `PanicInfo` types:
+/// - `core::panic::PanicInfo`, which is used as an argument to a `#[panic_handler]` in `#![no_std]` programs.
+/// - [`std::panic::PanicInfo`], which is used as an argument to a panic hook set by [`std::panic::set_hook`].
+///
+/// This is the first one.
+///
+/// [`std::panic::set_hook`]: ../../std/panic/fn.set_hook.html
+/// [`std::panic::PanicInfo`]: ../../std/panic/struct.PanicInfo.html
 #[lang = "panic_info"]
 #[stable(feature = "panic_hooks", since = "1.10.0")]
 #[derive(Debug)]