aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-12 15:47:48 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-12 15:47:48 +0000
commit8033c81acc93a376fbbecae6962ce35a0021aa8a (patch)
treeec45b93ee97ff1ba3ad7d5c773d767d421b2b554 /crates/ra_syntax/src
parent52ec6edf552d6b389af04649227fdea773e25138 (diff)
parent0b9e462ab0c6d74fd0bb34d9b9101132373e65a3 (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')
-rw-r--r--crates/ra_syntax/src/grammar/items/nominal.rs10
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");