diff options
| author | Nick Desaulniers <ndesaulniers@mozilla.com> | 2013-02-11 19:26:38 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-02-13 17:01:32 -0800 |
| commit | 4445b38df27777b043cad9ecc2452daad3469949 (patch) | |
| tree | f5258cb43faeb5f36f816e4a2d04442c987423b4 /src/libsyntax/ext | |
| parent | c51ecc3223ed64b7948f40097c5083da0c201811 (diff) | |
| download | rust-4445b38df27777b043cad9ecc2452daad3469949.tar.gz rust-4445b38df27777b043cad9ecc2452daad3469949.zip | |
Remove die!, raplace invocations with fail! Issue #4524 pt 3
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/auto_encode.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/parse_proto.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs index acbe4d7fa23..c854fca6424 100644 --- a/src/libsyntax/ext/auto_encode.rs +++ b/src/libsyntax/ext/auto_encode.rs @@ -812,7 +812,7 @@ fn mk_struct_fields(fields: ~[@ast::struct_field]) -> ~[field] { do fields.map |field| { let (ident, mutbl) = match field.node.kind { ast::named_field(ident, mutbl, _) => (ident, mutbl), - _ => die!(~"[auto_encode] does not support \ + _ => fail!(~"[auto_encode] does not support \ unnamed fields") }; @@ -954,9 +954,9 @@ fn mk_enum_ser_body( ast::tuple_variant_kind(args) => ser_variant(cx, span, variant.node.name, v_idx, args), ast::struct_variant_kind(*) => - die!(~"struct variants unimplemented"), + fail!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - die!(~"enum variants unimplemented"), + fail!(~"enum variants unimplemented"), } }; @@ -1047,9 +1047,9 @@ fn mk_enum_deser_body( } }, ast::struct_variant_kind(*) => - die!(~"struct variants unimplemented"), + fail!(~"struct variants unimplemented"), ast::enum_variant_kind(*) => - die!(~"enum variants unimplemented") + fail!(~"enum variants unimplemented") }; let pat = @ast::pat { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 18256369c78..17197f64c55 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -292,7 +292,7 @@ pub fn core_macros() -> ~str { ::core::sys::begin_unwind($msg, file!().to_owned(), line!()) ); () => ( - die!(~\"explicit failure\") + fail!(~\"explicit failure\") ) ) @@ -301,14 +301,14 @@ pub fn core_macros() -> ~str { ::core::sys::begin_unwind($msg, file!().to_owned(), line!()) ); () => ( - die!(~\"explicit failure\") + fail!(~\"explicit failure\") ) ) macro_rules! fail_unless( ($cond:expr) => { if !$cond { - die!(~\"assertion failed: \" + stringify!($cond)) + fail!(~\"assertion failed: \" + stringify!($cond)) } } ) diff --git a/src/libsyntax/ext/pipes/parse_proto.rs b/src/libsyntax/ext/pipes/parse_proto.rs index 1502332859c..6a1708b8e2b 100644 --- a/src/libsyntax/ext/pipes/parse_proto.rs +++ b/src/libsyntax/ext/pipes/parse_proto.rs @@ -40,13 +40,13 @@ pub impl parser::Parser: proto_parser { self.expect(token::COLON); let dir = match copy self.token { token::IDENT(n, _) => self.interner.get(n), - _ => die!() + _ => fail!() }; self.bump(); let dir = match dir { @~"send" => send, @~"recv" => recv, - _ => die!() + _ => fail!() }; let typarms = if self.token == token::LT { diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 4a9a22de50f..4522c7e0fd6 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -184,7 +184,7 @@ pub mod rt { Some(ast) => ast, None => { error!("Parse error with ```\n%s\n```", s); - die!() + fail!() } } } @@ -399,7 +399,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { ~[mk_ident(cx, sp, ident)]); } - INTERPOLATED(_) => die!(~"quote! with interpolated token"), + INTERPOLATED(_) => fail!(~"quote! with interpolated token"), _ => () } @@ -437,7 +437,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr { DOLLAR => "DOLLAR", UNDERSCORE => "UNDERSCORE", EOF => "EOF", - _ => die!() + _ => fail!() }; build::mk_path(cx, sp, ids_ext(cx, ~[name.to_owned()])) @@ -467,7 +467,7 @@ fn mk_tt(cx: ext_ctxt, sp: span, tt: &ast::token_tree) } ast::tt_delim(ref tts) => mk_tts(cx, sp, *tts), - ast::tt_seq(*) => die!(~"tt_seq in quote!"), + ast::tt_seq(*) => fail!(~"tt_seq in quote!"), ast::tt_nonterminal(sp, ident) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 4b1194bb5f1..9e89e703c09 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -124,7 +124,7 @@ pub type matcher_pos = ~{ pub fn copy_up(&& mpu: matcher_pos_up) -> matcher_pos { match &mpu { &matcher_pos_up(Some(ref mp)) => copy (*mp), - _ => die!() + _ => fail!() } } @@ -361,7 +361,7 @@ pub fn parse(sess: parse_sess, fmt!("%s ('%s')", *sess.interner.get(name), *sess.interner.get(bind)) } - _ => die!() + _ => fail!() } }), ~" or "); return error(sp, fmt!( "Local ambiguity: multiple parsing options: \ @@ -386,7 +386,7 @@ pub fn parse(sess: parse_sess, parse_nt(rust_parser, *sess.interner.get(name)))); ei.idx += 1u; } - _ => die!() + _ => fail!() } cur_eis.push(move ei); |
