From af3b132285bc9314d545cae2e4eaef079a26252a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 27 Sep 2013 21:01:58 -0700 Subject: syntax: Remove usage of fmt! --- src/libsyntax/print/pprust.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/libsyntax/print/pprust.rs') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index dee8d710a73..bc1a4721207 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -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 (given : &T, expected: &T) { if !(given == expected) { - fail!("given %?, expected %?", given, expected); + fail2!("given {:?}, expected {:?}", given, expected); } } -- cgit 1.4.1-3-g733a5