From fbbe24c82b8fc21a4a01a6e9a8f72d9a44bfd9a7 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 12 Sep 2025 19:08:29 +0200 Subject: [PATCH] Use writeln!() rather than print!() + concat!() in println!() This fixes using format arg captures --- src/macros.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index a9c83081f0..aa4692ffff 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -10,7 +10,8 @@ macro_rules! print { /// Print with new line to console #[macro_export] macro_rules! println { - () => (print!("\n")); - ($fmt:expr_2021) => (print!(concat!($fmt, "\n"))); - ($fmt:expr_2021, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*)); + ($($arg:tt)*) => ({ + use core::fmt::Write; + let _ = writeln!($crate::arch::debug::Writer::new(), $($arg)*); + }); }