aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-10-18 16:03:22 -0700
committerGraydon Hoare <[email protected]>2010-10-18 16:03:22 -0700
commitf747101b7c17120e2740e236452f024dca3e696e (patch)
tree67e0d4025e7bc73d9f3d6e923a1469865846771d
parentMake list.find return an option of different type than the list element. (diff)
downloadrust-f747101b7c17120e2740e236452f024dca3e696e.tar.xz
rust-f747101b7c17120e2740e236452f024dca3e696e.zip
Rewrite session formatting to use #fmt extension.
-rw-r--r--src/comp/driver/session.rs26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/comp/driver/session.rs b/src/comp/driver/session.rs
index 228e864f..831c6439 100644
--- a/src/comp/driver/session.rs
+++ b/src/comp/driver/session.rs
@@ -3,33 +3,21 @@ import std._uint;
obj session() {
fn span_err(span sp, str msg) {
- let str s = sp.filename;
- s += ':' as u8;
- // We really need #fmt soon!
- s += _uint.to_str(sp.lo.line, 10u);
- s += ':' as u8;
- s += _uint.to_str(sp.lo.col, 10u);
- s += ':' as u8;
- s += _uint.to_str(sp.hi.line, 10u);
- s += ':' as u8;
- s += _uint.to_str(sp.hi.col, 10u);
- s += ": error: ";
- s += msg;
- log s;
+ log #fmt("%s:%u:%u:%u:%u: error: %s",
+ sp.filename,
+ sp.lo.line, sp.lo.col,
+ sp.hi.line, sp.hi.col,
+ msg);
fail;
}
fn err(str msg) {
- let str s = "error: ";
- s += msg;
- log s;
+ log #fmt("error: %s", msg);
fail;
}
fn unimpl(str msg) {
- let str s = "error: unimplemented ";
- s += msg;
- log s;
+ log #fmt("error: unimplemented %s", msg);
fail;
}
}