From 4407d0910c2b8f2c778facbe8ab4e0507de9cdc8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 10 Jul 2021 18:30:32 +0100 Subject: [PATCH] Make dbgc macro actually useable in base Signed-off-by: Ian Jackson --- base/misc.rs | 10 +++++----- base/prelude.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base/misc.rs b/base/misc.rs index 10d9fb1a..47df4d6b 100644 --- a/base/misc.rs +++ b/base/misc.rs @@ -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)),+]) }; } diff --git a/base/prelude.rs b/base/prelude.rs index 91011f71..b1ec9193 100644 --- a/base/prelude.rs +++ b/base/prelude.rs @@ -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; -- 2.30.2