diff options
| author | comex <comexk@gmail.com> | 2017-01-14 18:04:27 -0500 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2017-01-14 18:44:35 -0500 |
| commit | 9cfb8b730a473814c2ae090c342abb95e53502db (patch) | |
| tree | ac757a3acf31331c3ef7c9a0f3f063b1d85c9fd6 /src/libsyntax/parse/parser.rs | |
| parent | 743535a643ff9c7f5791a71f6b62c27617cdbb3e (diff) | |
| parent | 93e70ecb7fbe05caa74dfb2bf3c29315edc2b3e6 (diff) | |
| download | rust-9cfb8b730a473814c2ae090c342abb95e53502db.tar.gz rust-9cfb8b730a473814c2ae090c342abb95e53502db.zip | |
Merge branch 'master' into lint-attr-fix
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 2bb38433a26..167fa78d7e0 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1946,6 +1946,7 @@ impl<'a> Parser<'a> { /// Parse ident (COLON expr)? pub fn parse_field(&mut self) -> PResult<'a, Field> { + let attrs = self.parse_outer_attributes()?; let lo = self.span.lo; let hi; @@ -1968,6 +1969,7 @@ impl<'a> Parser<'a> { span: mk_sp(lo, expr.span.hi), expr: expr, is_shorthand: is_shorthand, + attrs: attrs.into(), }) } @@ -3436,6 +3438,7 @@ impl<'a> Parser<'a> { if self.check(&token::CloseDelim(token::Brace)) { break } } + let attrs = self.parse_outer_attributes()?; let lo = self.span.lo; let hi; @@ -3493,9 +3496,13 @@ impl<'a> Parser<'a> { }; fields.push(codemap::Spanned { span: mk_sp(lo, hi), - node: ast::FieldPat { ident: fieldname, - pat: subpat, - is_shorthand: is_shorthand }}); + node: ast::FieldPat { + ident: fieldname, + pat: subpat, + is_shorthand: is_shorthand, + attrs: attrs.into(), + } + }); } return Ok((fields, etc)); } |
