diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-15 02:35:36 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-08-15 12:31:50 +0300 |
| commit | a6182711efe32d4dd68da2663129e3e2e462d8cb (patch) | |
| tree | 022f678d6a426f264dc06c7847542f55b531762d /src/libsyntax/parse/parser | |
| parent | 433b1e36e19824742175de681b8579c861217207 (diff) | |
| download | rust-a6182711efe32d4dd68da2663129e3e2e462d8cb.tar.gz rust-a6182711efe32d4dd68da2663129e3e2e462d8cb.zip | |
Remove `Spanned` from `{ast,hir}::FieldPat`
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/pat.rs | 22 |
1 files changed, 8 insertions, 14 deletions
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<Spanned<FieldPat>>, bool)> { + fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<FieldPat>, 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<Attribute> - ) -> PResult<'a, Spanned<FieldPat>> { + fn parse_pat_field(&mut self, lo: Span, attrs: Vec<Attribute>) -> 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, - } }) } |
