From 2959aa446e452d2176f9db453e52047453a3904e Mon Sep 17 00:00:00 2001 From: Ryan Cumming Date: Sun, 30 Jun 2019 19:55:50 +1000 Subject: 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. --- crates/ra_parser/src/grammar/expressions/atom.rs | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'crates/ra_parser/src/grammar/expressions') 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 { // 1, // 2, // ]; - let first_member_has_attrs = p.at(T![#]); attributes::outer_attributes(p); expr(p); if p.eat(T![;]) { - if first_member_has_attrs { - // test_err array_length_attributes - // pub const A: &[i64] = &[ - // #[cfg(test)] - // 1; - // 2, - // ]; - p.error("removing an expression is not supported in this position"); - } - expr(p); p.expect(T![']']); return m.complete(p, ARRAY_EXPR); -- cgit v1.2.3