mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
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:
parent
b01496538c
commit
2959aa446e
3 changed files with 0 additions and 76 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue