about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/panic/panic_info.rs9
-rw-r--r--library/std/src/panic.rs11
2 files changed, 18 insertions, 2 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)]
diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs
index 18072f6fe3d..54ab433d820 100644
--- a/library/std/src/panic.rs
+++ b/library/std/src/panic.rs
@@ -12,11 +12,16 @@ use crate::thread::Result;
 
 /// A struct providing information about a panic.
 ///
-/// `PanicInfo` structure is passed to a panic hook set by the [`set_hook`]
-/// function.
+/// `PanicInfo` structure is passed to a panic hook set by the [`set_hook`] function.
 ///
 /// [`set_hook`]: ../../std/panic/fn.set_hook.html
 ///
+/// 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 second one.
+///
 /// # Examples
 ///
 /// ```should_panic
@@ -28,6 +33,8 @@ use crate::thread::Result;
 ///
 /// panic!("critical system failure");
 /// ```
+///
+/// [`core::panic::PanicInfo`]: ../../core/panic/struct.PanicInfo.html
 #[stable(feature = "panic_hooks", since = "1.10.0")]
 #[derive(Debug)]
 pub struct PanicInfo<'a> {