]> git.lizzy.rs Git - rust.git/commitdiff
Partial fix for #1561, doesn't actually "fix" the problem but you get output now.
authorGraydon Hoare <graydon@mozilla.com>
Thu, 19 Jan 2012 18:53:20 +0000 (10:53 -0800)
committerGraydon Hoare <graydon@mozilla.com>
Thu, 19 Jan 2012 19:11:47 +0000 (11:11 -0800)
There's still something wrong with #error here, possibly cross-crate issue.

src/comp/driver/driver.rs

index ea961f917e52a471de1d605d75d62a03518fe6a5..f14d351c4fc320d97e7620e0803d588db1b9f44c 100644 (file)
@@ -13,7 +13,7 @@
 import core::{option, str, int, result};
 import result::{ok, err};
 import std::{fs, io, getopts};
-import io::reader_util;
+import io::{reader_util, writer_util};
 import option::{some, none};
 import getopts::{optopt, optmulti, optflag, optflagopt, opt_present};
 import back::{x86, x86_64};
@@ -104,8 +104,8 @@ fn time<T>(do_it: bool, what: str, thunk: fn@() -> T) -> T {
     let start = std::time::precise_time_s();
     let rv = thunk();
     let end = std::time::precise_time_s();
-    std::io::println(#fmt["time: %s took %s s", what,
-                          float::to_str(end - start, 3u)]);
+    io::stdout().write_str(#fmt("time: %3.3f s\t%s\n",
+                                end - start, what));
     ret rv;
 }