Skip to content

Commit a7a6837

Browse files
author
Esteban Küber
committed
Change eprintln!()
Address #30143 as well. `writeln!()` hasn't been changed.
1 parent 00d5000 commit a7a6837

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/libstd/macros.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,17 @@ macro_rules! eprint {
217217
/// ```
218218
#[macro_export]
219219
#[stable(feature = "eprint", since = "1.19.0")]
220+
#[allow_internal_unstable]
220221
macro_rules! eprintln {
221222
() => (eprint!("\n"));
222-
($fmt:expr) => (eprint!(concat!($fmt, "\n")));
223-
($fmt:expr, $($arg:tt)*) => (eprint!(concat!($fmt, "\n"), $($arg)*));
223+
($($arg:tt)*) => ({
224+
#[cfg(not(stage0))] {
225+
($crate::io::_eprint(format_args_nl!($($arg)*)));
226+
}
227+
#[cfg(stage0)] {
228+
eprint!("{}\n", format_args!($($arg)*))
229+
}
230+
})
224231
}
225232

226233
#[macro_export]

0 commit comments

Comments
 (0)