diff options
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 89a504e1ebd..36f01463205 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -44,7 +44,6 @@ use ast::{Visibility, WhereClause}; use attr::{ThinAttributes, ThinAttributesExt, AttributesExt}; use ast::{BinOpKind, UnOp}; use ast; -use ast_util::{self, ident_to_path}; use codemap::{self, Span, BytePos, Spanned, spanned, mk_sp, CodeMap}; use errors::{self, DiagnosticBuilder}; use ext::tt::macro_parser; @@ -1577,9 +1576,14 @@ impl<'a> Parser<'a> { pat } else { debug!("parse_arg_general ident_to_pat"); - ast_util::ident_to_pat(ast::DUMMY_NODE_ID, - self.last_span, - special_idents::invalid) + let sp = self.last_span; + let spanned = Spanned { span: sp, node: special_idents::invalid }; + P(Pat { + id: ast::DUMMY_NODE_ID, + node: PatKind::Ident(BindingMode::ByValue(Mutability::Immutable), + spanned, None), + span: sp + }) }; let t = self.parse_ty_sum()?; @@ -2223,7 +2227,7 @@ impl<'a> Parser<'a> { ctxt: _ }, token::Plain) => { self.bump(); - let path = ast_util::ident_to_path(mk_sp(lo, hi), id); + let path = ast::Path::from_ident(mk_sp(lo, hi), id); ex = ExprKind::Path(None, path); hi = self.last_span.hi; } @@ -3679,7 +3683,7 @@ impl<'a> Parser<'a> { // Parse macro invocation let ident = self.parse_ident()?; let ident_span = self.last_span; - let path = ident_to_path(ident_span, ident); + let path = ast::Path::from_ident(ident_span, ident); self.bump(); let delim = self.expect_open_delim()?; let tts = self.parse_seq_to_end( @@ -5116,7 +5120,7 @@ impl<'a> Parser<'a> { self.expect(&token::OpenDelim(token::Brace))?; self.expect(&token::CloseDelim(token::Brace))?; - Ok((ast_util::impl_pretty_name(&opt_trait, None), + Ok((special_idents::invalid, ItemKind::DefaultImpl(unsafety, opt_trait.unwrap()), None)) } else { if opt_trait.is_some() { @@ -5132,7 +5136,7 @@ impl<'a> Parser<'a> { impl_items.push(self.parse_impl_item()?); } - Ok((ast_util::impl_pretty_name(&opt_trait, Some(&ty)), + Ok((special_idents::invalid, ItemKind::Impl(unsafety, polarity, generics, opt_trait, ty, impl_items), Some(attrs))) } |
