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.
This commit is contained in:
Ryan Cumming 2019-06-30 19:55:50 +10:00
parent b01496538c
commit 2959aa446e
3 changed files with 0 additions and 76 deletions

View file

@ -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);