about summary refs log tree commit diff
path: root/src/libstd/macros.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2017-08-08 11:24:30 +0200
committerest31 <MTest31@outlook.com>2017-08-08 11:35:09 +0200
commitb6ac9c0d302b361ae1747c496f1bd88f04e556d8 (patch)
tree00784d9f8da84c408346ca5bc27a7170f019b4a0 /src/libstd/macros.rs
parent7c4e1a5036db1085d118ab83f76be431695602f6 (diff)
downloadrust-b6ac9c0d302b361ae1747c496f1bd88f04e556d8.tar.gz
rust-b6ac9c0d302b361ae1747c496f1bd88f04e556d8.zip
Avoid calling the column!() macro in panic
Diffstat (limited to 'src/libstd/macros.rs')
-rw-r--r--src/libstd/macros.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 03db1e4f01c..5e88a46ecc3 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -14,6 +14,16 @@
 //! library. Each macro is available for use when linking against the standard
 //! library.
 
+#[macro_export]
+// This stability attribute is totally useless.
+#[stable(feature = "rust1", since = "1.0.0")]
+#[cfg(stage0)]
+macro_rules! __rust_unstable_column {
+    () => {
+        column!()
+    }
+}
+
 /// The entry point for panic of Rust threads.
 ///
 /// This macro is used to inject panic into a Rust thread, causing the thread to
@@ -48,7 +58,8 @@ macro_rules! panic {
     ($msg:expr) => ({
         $crate::rt::begin_panic($msg, {
             // static requires less code at runtime, more constant data
-            static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(), column!());
+            static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(),
+                __rust_unstable_column!());
             &_FILE_LINE_COL
         })
     });
@@ -58,7 +69,8 @@ macro_rules! panic {
             // used inside a dead function. Just `#[allow(dead_code)]` is
             // insufficient, since the user may have
             // `#[forbid(dead_code)]` and which cannot be overridden.
-            static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(), column!());
+            static _FILE_LINE_COL: (&'static str, u32, u32) = (file!(), line!(),
+                __rust_unstable_column!());
             &_FILE_LINE_COL
         })
     });