diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-12 15:47:48 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-12 15:47:48 +0000 |
commit | 8033c81acc93a376fbbecae6962ce35a0021aa8a (patch) | |
tree | ec45b93ee97ff1ba3ad7d5c773d767d421b2b554 /crates/ra_syntax/src/grammar/items | |
parent | 52ec6edf552d6b389af04649227fdea773e25138 (diff) | |
parent | 0b9e462ab0c6d74fd0bb34d9b9101132373e65a3 (diff) |
Merge #507
507: Fix handling of attributes in positional field lists r=matklad a=DJMcNab
First reported by @max-frai. This allows us to properly handle crates using e.g. `#[Derive(fail)]` with `#[fail(cause)]`, among other cases.
Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar/items')
-rw-r--r-- | crates/ra_syntax/src/grammar/items/nominal.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/grammar/items/nominal.rs b/crates/ra_syntax/src/grammar/items/nominal.rs index 495462ca7..0784fb7b1 100644 --- a/crates/ra_syntax/src/grammar/items/nominal.rs +++ b/crates/ra_syntax/src/grammar/items/nominal.rs | |||
@@ -140,6 +140,16 @@ fn pos_field_list(p: &mut Parser) { | |||
140 | } | 140 | } |
141 | while !p.at(R_PAREN) && !p.at(EOF) { | 141 | while !p.at(R_PAREN) && !p.at(EOF) { |
142 | let m = p.start(); | 142 | let m = p.start(); |
143 | // test pos_field_attrs | ||
144 | // struct S ( | ||
145 | // #[serde(with = "url_serde")] | ||
146 | // pub Uri, | ||
147 | // ); | ||
148 | // | ||
149 | // enum S { | ||
150 | // Uri(#[serde(with = "url_serde")] Uri), | ||
151 | // } | ||
152 | attributes::outer_attributes(p); | ||
143 | opt_visibility(p); | 153 | opt_visibility(p); |
144 | if !p.at_ts(types::TYPE_FIRST) { | 154 | if !p.at_ts(types::TYPE_FIRST) { |
145 | p.error("expected a type"); | 155 | p.error("expected a type"); |