about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-25 12:24:39 +0100
committerRalf Jung <post@ralfj.de>2019-11-25 23:55:54 +0100
commit3c485795517d1f5a6ebfff6368dfae7a7cd85b85 (patch)
treea82b02113c7c47a5c7945a20f361bedc978cd2d4 /src/libcore
parent08f779cb4b481be58eeb5ecc421f69503780e8b1 (diff)
downloadrust-3c485795517d1f5a6ebfff6368dfae7a7cd85b85.tar.gz
rust-3c485795517d1f5a6ebfff6368dfae7a7cd85b85.zip
more panicking comments
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/panicking.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs
index 4833194be37..5a8d647396d 100644
--- a/src/libcore/panicking.rs
+++ b/src/libcore/panicking.rs
@@ -11,13 +11,13 @@
 //! ```
 //!
 //! This definition allows for panicking with any general message, but it does not
-//! allow for failing with a `Box<Any>` value. The reason for this is that libcore
-//! is not allowed to allocate.
+//! allow for failing with a `Box<Any>` value. (`PanicInfo` just contains a `&(dyn Any + Send)`,
+//! for which we fill in a dummy value in `PanicInfo::internal_constructor`.)
+//! The reason for this is that libcore is not allowed to allocate.
 //!
 //! This module contains a few other panicking functions, but these are just the
 //! necessary lang items for the compiler. All panics are funneled through this
-//! one function. Currently, the actual symbol is declared in the standard
-//! library, but the location of this may change over time.
+//! one function. The actual symbol is declared through the `#[panic_handler]` attribute.
 
 // ignore-tidy-undocumented-unsafe
 
@@ -72,6 +72,7 @@ pub fn panic_fmt(fmt: fmt::Arguments<'_>, location: &Location<'_>) -> ! {
     }
 
     // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
+    // that gets resolved to the `#[panic_handler]` function.
     extern "Rust" {
         #[lang = "panic_impl"]
         fn panic_impl(pi: &PanicInfo<'_>) -> !;