Skip to content

Commit

Permalink
Change eprintln!()
Browse files Browse the repository at this point in the history
Address rust-lang#30143 as well. `writeln!()` hasn't been changed.
  • Loading branch information
Esteban Küber committed Jul 21, 2018
1 parent 00d5000 commit a7a6837
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,17 @@ macro_rules! eprint {
/// ```
#[macro_export]
#[stable(feature = "eprint", since = "1.19.0")]
#[allow_internal_unstable]
macro_rules! eprintln {
() => (eprint!("\n"));
($fmt:expr) => (eprint!(concat!($fmt, "\n")));
($fmt:expr, $($arg:tt)*) => (eprint!(concat!($fmt, "\n"), $($arg)*));
($($arg:tt)*) => ({
#[cfg(not(stage0))] {
($crate::io::_eprint(format_args_nl!($($arg)*)));
}
#[cfg(stage0)] {
eprint!("{}\n", format_args!($($arg)*))
}
})
}

#[macro_export]
Expand Down

0 comments on commit a7a6837

Please sign in to comment.