diff options
author | Ryan Cumming <[email protected]> | 2019-06-30 10:55:50 +0100 |
---|---|---|
committer | Ryan Cumming <[email protected]> | 2019-06-30 10:55:50 +0100 |
commit | 2959aa446e452d2176f9db453e52047453a3904e (patch) | |
tree | dbbf03d1a15b142cbc14087f61c9c2ba74d7d35b /crates/ra_parser/src/grammar | |
parent | b01496538c938d6a0c904512a38e4325cc960334 (diff) |
Remove parse error on array initializer attributes
This is actually allowed by the `rustc` parser but most attributes will
fail later due to attributes on expressions being experimental.
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index 5e51d667e..6bda04141 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -177,21 +177,10 @@ fn array_expr(p: &mut Parser) -> CompletedMarker { | |||
177 | // 1, | 177 | // 1, |
178 | // 2, | 178 | // 2, |
179 | // ]; | 179 | // ]; |
180 | let first_member_has_attrs = p.at(T![#]); | ||
181 | attributes::outer_attributes(p); | 180 | attributes::outer_attributes(p); |
182 | 181 | ||
183 | expr(p); | 182 | expr(p); |
184 | if p.eat(T![;]) { | 183 | if p.eat(T![;]) { |
185 | if first_member_has_attrs { | ||
186 | // test_err array_length_attributes | ||
187 | // pub const A: &[i64] = &[ | ||
188 | // #[cfg(test)] | ||
189 | // 1; | ||
190 | // 2, | ||
191 | // ]; | ||
192 | p.error("removing an expression is not supported in this position"); | ||
193 | } | ||
194 | |||
195 | expr(p); | 184 | expr(p); |
196 | p.expect(T![']']); | 185 | p.expect(T![']']); |
197 | return m.complete(p, ARRAY_EXPR); | 186 | return m.complete(p, ARRAY_EXPR); |