mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Add validation for mutable const items
This commit is contained in:
parent
89fef5307e
commit
70d43c3faf
6 changed files with 40 additions and 25 deletions
|
@ -13,7 +13,7 @@ pub(super) fn konst(p: &mut Parser, m: Marker) {
|
|||
fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
|
||||
assert!(p.at(kw));
|
||||
p.bump(kw);
|
||||
p.eat(T![mut]); // FIXME: validator to forbid const mut
|
||||
p.eat(T![mut]);
|
||||
|
||||
// Allow `_` in place of an identifier in a `const`.
|
||||
let is_const_underscore = kw == T![const] && p.eat(T![_]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue