From a6182711efe32d4dd68da2663129e3e2e462d8cb Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 15 Aug 2019 02:35:36 +0300 Subject: Remove `Spanned` from `{ast,hir}::FieldPat` --- src/libsyntax/parse/parser/pat.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index da44ebd8415..c3079d2da0c 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -488,7 +488,7 @@ impl<'a> Parser<'a> { } /// Parses the fields of a struct-like pattern. - fn parse_pat_fields(&mut self) -> PResult<'a, (Vec>, bool)> { + fn parse_pat_fields(&mut self) -> PResult<'a, (Vec, bool)> { let mut fields = Vec::new(); let mut etc = false; let mut ate_comma = true; @@ -620,11 +620,7 @@ impl<'a> Parser<'a> { .emit(); } - fn parse_pat_field( - &mut self, - lo: Span, - attrs: Vec - ) -> PResult<'a, Spanned> { + fn parse_pat_field(&mut self, lo: Span, attrs: Vec) -> PResult<'a, FieldPat> { // Check if a colon exists one ahead. This means we're parsing a fieldname. let hi; let (subpat, fieldname, is_shorthand) = if self.look_ahead(1, |t| t == &token::Colon) { @@ -659,15 +655,13 @@ impl<'a> Parser<'a> { (subpat, fieldname, true) }; - Ok(Spanned { + Ok(FieldPat { + ident: fieldname, + pat: subpat, + is_shorthand, + attrs: attrs.into(), + id: ast::DUMMY_NODE_ID, span: lo.to(hi), - node: FieldPat { - ident: fieldname, - pat: subpat, - is_shorthand, - attrs: attrs.into(), - id: ast::DUMMY_NODE_ID, - } }) } -- cgit 1.4.1-3-g733a5