diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2023-09-26 14:40:36 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2024-06-11 15:46:59 +0200 |
| commit | a519dc85f8aa1348ec9cdc46906bbcbb9d115981 (patch) | |
| tree | c176c5e9d45fbd73c2ddd1344377f13f8e297d19 /library/std/src | |
| parent | e3e815370e824a9d7e74024da54acbe5ac477786 (diff) | |
| download | rust-a519dc85f8aa1348ec9cdc46906bbcbb9d115981.tar.gz rust-a519dc85f8aa1348ec9cdc46906bbcbb9d115981.zip | |
Document difference between core and std's PanicInfo.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/panic.rs | 11 |
1 files changed, 9 insertions, 2 deletions
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> { |
