Skip to content

Commit 2959aa4

Browse files
committed
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.
1 parent b014965 commit 2959aa4

File tree

3 files changed

+0
-76
lines changed

3 files changed

+0
-76
lines changed

crates/ra_parser/src/grammar/expressions/atom.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,10 @@ fn array_expr(p: &mut Parser) -> CompletedMarker {
177177
// 1,
178178
// 2,
179179
// ];
180-
let first_member_has_attrs = p.at(T![#]);
181180
attributes::outer_attributes(p);
182181

183182
expr(p);
184183
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-
195184
expr(p);
196185
p.expect(T![']']);
197186
return m.complete(p, ARRAY_EXPR);

crates/ra_syntax/tests/data/parser/inline/err/0015_array_length_attributes.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/ra_syntax/tests/data/parser/inline/err/0015_array_length_attributes.txt

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)