about summary refs log tree commit diff
path: root/src/liblog
diff options
context:
space:
mode:
authorBrian Brooks <brooks.brian@gmail.com>2015-02-21 17:26:29 -0500
committerBrian Brooks <brooks.brian@gmail.com>2015-02-21 17:26:29 -0500
commitfc9fa1a563c48cc928c8c5754597ffba6f53a635 (patch)
treec8b6dce437b1f392a9508ffa32b4538c553794b7 /src/liblog
parent1212fd8abc7602f6c506c936908a799c76549a14 (diff)
downloadrust-fc9fa1a563c48cc928c8c5754597ffba6f53a635.tar.gz
rust-fc9fa1a563c48cc928c8c5754597ffba6f53a635.zip
Resolve barriers to changing column!() / line!() return type to u32 in #19284 . Address review comments in #21769 .
Diffstat (limited to 'src/liblog')
-rw-r--r--src/liblog/lib.rs4
-rw-r--r--src/liblog/macros.rs9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs
index c2c7f20ce9c..5c008d35cb3 100644
--- a/src/liblog/lib.rs
+++ b/src/liblog/lib.rs
@@ -342,7 +342,7 @@ pub struct LogRecord<'a> {
     pub file: &'a str,
 
     /// The line number of where the LogRecord originated.
-    pub line: uint,
+    pub line: u32,
 }
 
 #[doc(hidden)]
@@ -350,7 +350,7 @@ pub struct LogRecord<'a> {
 pub struct LogLocation {
     pub module_path: &'static str,
     pub file: &'static str,
-    pub line: uint,
+    pub line: u32,
 }
 
 /// Tests whether a given module's name is enabled for a particular level of
diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs
index 787d9c470d4..b1d292ebaa8 100644
--- a/src/liblog/macros.rs
+++ b/src/liblog/macros.rs
@@ -50,8 +50,15 @@
 #[macro_export]
 macro_rules! log {
     ($lvl:expr, $($arg:tt)+) => ({
+        #[cfg(stage0)]
         static LOC: ::log::LogLocation = ::log::LogLocation {
-            line: line!() as usize,
+            line: line!() as u32,
+            file: file!(),
+            module_path: module_path!(),
+        };
+        #[cfg(not(stage0))]
+        static LOC: ::log::LogLocation = ::log::LogLocation {
+            line: line!(),
             file: file!(),
             module_path: module_path!(),
         };