syntax: Remove usage of fmt!

This commit is contained in:
Alex Crichton
2013-09-27 21:01:58 -07:00
parent 7e709bfd0d
commit af3b132285
34 changed files with 342 additions and 342 deletions

View File

@@ -453,10 +453,10 @@ pub fn print_type(s: @ps, ty: &ast::Ty) {
word(s.s, ")");
}
ast::ty_mac(_) => {
fail!("print_type doesn't know how to print a ty_mac");
fail2!("print_type doesn't know how to print a ty_mac");
}
ast::ty_infer => {
fail!("print_type shouldn't see a ty_infer");
fail2!("print_type shouldn't see a ty_infer");
}
}
@@ -709,7 +709,7 @@ pub fn print_struct(s: @ps,
popen(s);
do commasep(s, inconsistent, struct_def.fields) |s, field| {
match field.node.kind {
ast::named_field(*) => fail!("unexpected named field"),
ast::named_field(*) => fail2!("unexpected named field"),
ast::unnamed_field => {
maybe_print_comment(s, field.span.lo);
print_type(s, &field.node.ty);
@@ -728,7 +728,7 @@ pub fn print_struct(s: @ps,
for field in struct_def.fields.iter() {
match field.node.kind {
ast::unnamed_field => fail!("unexpected unnamed field"),
ast::unnamed_field => fail2!("unexpected unnamed field"),
ast::named_field(ident, visibility) => {
hardbreak_if_not_bol(s);
maybe_print_comment(s, field.span.lo);
@@ -1017,7 +1017,7 @@ pub fn print_if(s: @ps, test: &ast::Expr, blk: &ast::Block,
}
// BLEAH, constraints would be great here
_ => {
fail!("print_if saw if with weird alternative");
fail2!("print_if saw if with weird alternative");
}
}
}
@@ -1042,7 +1042,7 @@ pub fn print_mac(s: @ps, m: &ast::mac) {
pub fn print_vstore(s: @ps, t: ast::Vstore) {
match t {
ast::VstoreFixed(Some(i)) => word(s.s, fmt!("%u", i)),
ast::VstoreFixed(Some(i)) => word(s.s, format!("{}", i)),
ast::VstoreFixed(None) => word(s.s, "_"),
ast::VstoreUniq => word(s.s, "~"),
ast::VstoreBox => word(s.s, "@"),
@@ -1319,7 +1319,7 @@ pub fn print_expr(s: @ps, expr: &ast::Expr) {
}
end(s); // close enclosing cbox
}
None => fail!()
None => fail2!()
}
} else {
// the block will close the pattern's ibox
@@ -2299,7 +2299,7 @@ mod test {
fn string_check<T:Eq> (given : &T, expected: &T) {
if !(given == expected) {
fail!("given %?, expected %?", given, expected);
fail2!("given {:?}, expected {:?}", given, expected);
}
}