From be48d663dc1cf84f9a079772808cad2c18a45e93 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 6 Nov 2015 03:55:49 +0530 Subject: [PATCH] Update to rustc 1.6.0-dev (74185aff2 2015-11-05) --- macros/Cargo.toml | 2 +- macros/src/match_token.rs | 4 ++-- macros/src/pre_expand.rs | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 6aede1ef..776dbc6a 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "html5ever_macros" -version = "0.2.4" +version = "0.2.5" authors = [ "The html5ever Project Developers" ] license = "MIT / Apache-2.0" repository = "https://github.com/servo/html5ever" diff --git a/macros/src/match_token.rs b/macros/src/match_token.rs index 65b6938f..1ee07bb6 100644 --- a/macros/src/match_token.rs +++ b/macros/src/match_token.rs @@ -216,7 +216,7 @@ fn parse(cx: &mut ExtCtxt, toks: &[ast::TokenTree]) -> Result let lhs_lo = parser.span.lo; let lhs = match parser.token { - token::Underscore | token::Ident(..) => Pat(parser.parse_pat()), + token::Underscore | token::Ident(..) => Pat(try!(parser.parse_pat_nopanic())), token::Lt => { let mut tags = Vec::new(); while parser.token != token::FatArrow { @@ -438,7 +438,7 @@ pub fn expand_to_tokens(cx: &mut ExtCtxt, span: Span, toks: &[ast::TokenTree]) (None, Tags(_), _) => ext_err!(lhs.span, "the last arm cannot have tag patterns"), (None, _, Else) => ext_err!(rhs.span, "the last arm cannot use 'else'"), (None, Pat(p), Expr(e)) => match p.node { - ast::PatWild(ast::PatWildSingle) | ast::PatIdent(..) => (p, e), + ast::PatWild | ast::PatIdent(..) => (p, e), _ => ext_err!(lhs.span, "the last arm must have a wildcard or ident pattern"), }, }; diff --git a/macros/src/pre_expand.rs b/macros/src/pre_expand.rs index 0bacca20..5b3c302a 100644 --- a/macros/src/pre_expand.rs +++ b/macros/src/pre_expand.rs @@ -15,7 +15,6 @@ use std::path::Path; use std::rc::Rc; use syntax::{ast, codemap, ext, parse, print}; use syntax::parse::token; -use syntax::parse::attr::ParserAttr; pub fn pre_expand(from: &Path, to: &Path) { let mut source = String::new(); @@ -101,9 +100,9 @@ fn expn_info(span: codemap::Span) -> codemap::ExpnInfo { fn pretty(cx: &mut ext::base::ExtCtxt, tts: Vec) -> Vec { let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts); let start_span = parser.span; - let attrs = parser.parse_inner_attributes(); let mut items = Vec::new(); - while let Some(item) = parser.parse_item() { + let attrs = parser.parse_inner_attributes().unwrap(); + while let Ok(Some(item)) = parser.parse_item_nopanic() { items.push(item) } cx.bt_push(expn_info(start_span));