]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/macros.rs
Auto merge of #68522 - estebank:impl-trait-sugg-2, r=oli-obk
[rust.git] / src / libstd / macros.rs
index 11850a1b5fc3884200dc12eb5ec131384629d845..18fb0f87688dea28d9e3ee577a5f5413b739306d 100644 (file)
@@ -4,6 +4,7 @@
 //! library. Each macro is available for use when linking against the standard
 //! library.
 
+#[cfg(bootstrap)]
 #[doc(include = "../libcore/macros/panic.md")]
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -19,8 +20,21 @@ macro_rules! panic {
         $crate::panic!($msg)
     });
     ($fmt:expr, $($arg:tt)+) => ({
-        $crate::rt::begin_panic_fmt(&$crate::format_args!($fmt, $($arg)+),
-                                    &($crate::file!(), $crate::line!(), $crate::column!()))
+        $crate::rt::begin_panic_fmt(&$crate::format_args!($fmt, $($arg)+))
+    });
+}
+
+#[cfg(not(bootstrap))]
+#[doc(include = "../libcore/macros/panic.md")]
+#[macro_export]
+#[stable(feature = "rust1", since = "1.0.0")]
+#[allow_internal_unstable(libstd_sys_internals)]
+macro_rules! panic {
+    () => ({ $crate::panic!("explicit panic") });
+    ($msg:expr) => ({ $crate::rt::begin_panic($msg) });
+    ($msg:expr,) => ({ $crate::panic!($msg) });
+    ($fmt:expr, $($arg:tt)+) => ({
+        $crate::rt::begin_panic_fmt(&$crate::format_args!($fmt, $($arg)+))
     });
 }