chiark / gitweb /
Make dbgc macro actually useable in base
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Jul 2021 17:30:32 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Jul 2021 18:20:09 +0000 (19:20 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/misc.rs
base/prelude.rs

index 10d9fb1aba18580a9e7a6dd5a7417708cb4a5158..47df4d6bc009abe372f58721146e4ecd78d3b908 100644 (file)
@@ -129,21 +129,21 @@ macro_rules! dbgc {
     // `$val` expression could be a block (`{ .. }`), in which case the `eprintln!`
     // will be malformed.
     () => {
-      dbgc_helper(std::file!(), std::line!(), &[])
+      $crate::misc::dbgc_helper(std::file!(), std::line!(), &[])
     };
     ($val:expr $(,)?) => {
         // Use of `match` here is intentional because it affects the lifetimes
         // of temporaries - https://stackoverflow.com/a/48732525/1063961
         match $val {
             tmp => {
-                dbgc_helper(std::file!(), std::line!(),
-                            &[(std::stringify!($val), &tmp)]);
+                $crate::misc::dbgc_helper(std::file!(), std::line!(),
+                                          &[(std::stringify!($val), &tmp)]);
                 tmp
             }
         }
     };
     ($($val:expr),+ $(,)?) => {
-      dbgc_helper(std::file!(), std::line!(),
-                  &[$((std::stringify!($val), &$val)),+])
+      $crate::misc::dbgc_helper(std::file!(), std::line!(),
+                                &[$((std::stringify!($val), &$val)),+])
     };
 }
index 91011f71c8b7d14fa68a9cb853a4c86ea3f1ccff..b1ec9193078d25d84ff7bd5162c11deafad89fe8 100644 (file)
@@ -29,7 +29,7 @@ pub use void::{self, Void};
 pub use crate::html::*;
 
 pub use crate::geometry::{CoordinateOverflow, PosC, PosPromote};
-pub use crate::{hformat, hformat_as_display, hwrite};
+pub use crate::{dbgc, hformat, hformat_as_display, hwrite};
 pub use crate::misc::default;
 pub use crate::misc::display_as_debug;