]> git.lizzy.rs Git - rust.git/commitdiff
std: Use correct conventions for statics in macros
authorBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:54:56 +0000 (15:54 -0700)
committerBrian Anderson <banderson@mozilla.com>
Fri, 25 Jul 2014 22:54:56 +0000 (15:54 -0700)
src/libstd/macros.rs

index 9ce142836cf60add1fcf7829bb32676a6027858e..f3f47e3923d95e293102ce3a544a31164f3380c0 100644 (file)
 macro_rules! fail(
     () => ({
         // static requires less code at runtime, more constant data
-        static file_line: (&'static str, uint) = (file!(), line!());
-        ::std::rt::begin_unwind_no_time_to_explain(&file_line)
+        static FILE_LINE: (&'static str, uint) = (file!(), line!());
+        ::std::rt::begin_unwind_no_time_to_explain(&FILE_LINE)
     });
     ($msg:expr) => ({
-        static file_line: (&'static str, uint) = (file!(), line!());
-        let (file, line) = file_line;
+        static FILE_LINE: (&'static str, uint) = (file!(), line!());
+        let (file, line) = FILE_LINE;
         ::std::rt::begin_unwind($msg, file, line)
     });
     ($fmt:expr, $($arg:tt)*) => ({
@@ -62,8 +62,8 @@ macro_rules! fail(
         // up with the number of calls to fail!()
         #[inline(always)]
         fn run_fmt(fmt: &::std::fmt::Arguments) -> ! {
-            static file_line: (&'static str, uint) = (file!(), line!());
-            ::std::rt::begin_unwind_fmt(fmt, &file_line)
+            static FILE_LINE: (&'static str, uint) = (file!(), line!());
+            ::std::rt::begin_unwind_fmt(fmt, &FILE_LINE)
         }
         format_args!(run_fmt, $fmt, $($arg)*)
     });