Fallout of changing format_args!(f, args) to f(format_args!(args)).

This commit is contained in:
Eduard Burtescu
2014-12-27 23:57:43 +02:00
parent fc3f22bf25
commit 647e54d6d1
20 changed files with 627 additions and 91 deletions

View File

@@ -112,12 +112,25 @@ impl fmt::FormatWriter for Stdio {
}
}
// NOTE(stage0): Remove cfg after a snapshot
#[cfg(not(stage0))]
pub fn dumb_print(args: fmt::Arguments) {
let _ = Stderr.write_fmt(args);
}
// NOTE(stage0): Remove function after a snapshot
#[cfg(stage0)]
pub fn dumb_print(args: &fmt::Arguments) {
let mut w = Stderr;
let _ = write!(&mut w, "{}", args);
}
pub fn abort(args: &fmt::Arguments) -> ! {
// NOTE(stage0): Remove wrappers after a snapshot
#[cfg(not(stage0))] pub fn abort(args: fmt::Arguments) -> ! { abort_(&args) }
#[cfg(stage0)] pub fn abort(args: &fmt::Arguments) -> ! { abort_(args) }
// NOTE(stage0): Change to `pub fn abort(args: fmt::Arguments) -> !` after a snapshot
fn abort_(args: &fmt::Arguments) -> ! {
use fmt::FormatWriter;
struct BufWriter<'a> {