From eda52cbc348f37c1ae4391da901b2d605e161716 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Aug 2018 13:20:59 +0300 Subject: allow field attrs --- crates/libsyntax2/src/grammar/items/structs.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/grammar') diff --git a/crates/libsyntax2/src/grammar/items/structs.rs b/crates/libsyntax2/src/grammar/items/structs.rs index 80e77edd3..41bd2a4e0 100644 --- a/crates/libsyntax2/src/grammar/items/structs.rs +++ b/crates/libsyntax2/src/grammar/items/structs.rs @@ -84,15 +84,21 @@ fn named_fields(p: &mut Parser) { p.expect(R_CURLY); fn named_field(p: &mut Parser) { - let field = p.start(); + let m = p.start(); + // test field_attrs + // struct S { + // #[serde(with = "url_serde")] + // pub uri: Uri, + // } + attributes::outer_attributes(p); visibility(p); if p.at(IDENT) { name(p); p.expect(COLON); types::type_(p); - field.complete(p, NAMED_FIELD); + m.complete(p, NAMED_FIELD); } else { - field.abandon(p); + m.abandon(p); p.err_and_bump("expected field declaration"); } } -- cgit v1.2.3