about summary refs log tree commit diff
path: root/src/libcore/panic.rs
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2018-04-30 10:55:24 +0200
committerJorge Aparicio <jorge@japaric.io>2018-06-03 13:46:19 +0200
commite44ad61a2d8e3bac1d2cbf2467a7202250b8a77e (patch)
treee9b2eede0e5f2703640bb76f3e7f1b1c8e23fbd2 /src/libcore/panic.rs
parent3575be60eab140e69e5a75fe5c3b4119c2a17179 (diff)
downloadrust-e44ad61a2d8e3bac1d2cbf2467a7202250b8a77e.tar.gz
rust-e44ad61a2d8e3bac1d2cbf2467a7202250b8a77e.zip
implement #[panic_implementation]
Diffstat (limited to 'src/libcore/panic.rs')
-rw-r--r--src/libcore/panic.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs
index 27ec4aaac75..37ae05309af 100644
--- a/src/libcore/panic.rs
+++ b/src/libcore/panic.rs
@@ -35,6 +35,7 @@ use fmt;
 ///
 /// panic!("Normal panic");
 /// ```
+#[cfg_attr(not(stage0), lang = "panic_info")]
 #[stable(feature = "panic_hooks", since = "1.10.0")]
 #[derive(Debug)]
 pub struct PanicInfo<'a> {
@@ -53,7 +54,8 @@ impl<'a> PanicInfo<'a> {
     pub fn internal_constructor(message: Option<&'a fmt::Arguments<'a>>,
                                 location: Location<'a>)
                                 -> Self {
-        PanicInfo { payload: &(), location, message }
+        struct NoPayload;
+        PanicInfo { payload: &NoPayload, location, message }
     }
 
     #[doc(hidden)]
@@ -121,7 +123,7 @@ impl<'a> PanicInfo<'a> {
     #[stable(feature = "panic_hooks", since = "1.10.0")]
     pub fn location(&self) -> Option<&Location> {
         // NOTE: If this is changed to sometimes return None,
-        // deal with that case in std::panicking::default_hook.
+        // deal with that case in std::panicking::default_hook and std::panicking::begin_panic_fmt.
         Some(&self.location)
     }
 }