about summary refs log tree commit diff
path: root/src/libstd/macros.rs
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-09-04 13:23:49 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2017-09-10 11:20:27 +0300
commit10f66bd6e494c5b329f6b21b31e388e0ed3d69c1 (patch)
tree22e9e543225146285445d3382432f96c9b67760e /src/libstd/macros.rs
parentddd123ed9a35ec76103d42cecf322ee8d2896bf9 (diff)
downloadrust-10f66bd6e494c5b329f6b21b31e388e0ed3d69c1.tar.gz
rust-10f66bd6e494c5b329f6b21b31e388e0ed3d69c1.zip
Use rvalue promotion to 'static instead of static items.
Diffstat (limited to 'src/libstd/macros.rs')
-rw-r--r--src/libstd/macros.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 72d561fae3b..8089671f309 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -66,23 +66,11 @@ macro_rules! panic {
         panic!("explicit 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!(),
-                __rust_unstable_column!());
-            &_FILE_LINE_COL
-        })
+        $crate::rt::begin_panic($msg, &(file!(), line!(), __rust_unstable_column!()))
     });
     ($fmt:expr, $($arg:tt)+) => ({
-        $crate::rt::begin_panic_fmt(&format_args!($fmt, $($arg)+), {
-            // The leading _'s are to avoid dead code warnings if this is
-            // 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!(),
-                __rust_unstable_column!());
-            &_FILE_LINE_COL
-        })
+        $crate::rt::begin_panic_fmt(&format_args!($fmt, $($arg)+),
+                                    &(file!(), line!(), __rust_unstable_column!()))
     });
 }