Skip to content

Commit 22f67e9

Browse files
fixup
1 parent 3ea74e5 commit 22f67e9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/ra_parser/src/grammar/items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> {
258258
}
259259
T![enum] => nominal::enum_def(p, m),
260260
T![use] => use_item::use_item(p, m),
261-
T![const] if (la == UNDERSCORE || la == IDENT || la == T![mut]) => consts::const_def(p, m),
261+
T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::const_def(p, m),
262262
T![static] => consts::static_def(p, m),
263263
// test extern_block
264264
// extern {}

crates/ra_parser/src/grammar/items/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
1414
p.eat(T![mut]); // FIXME: validator to forbid const mut
1515

1616
// Allow `_` in place of an identifier in a `const`.
17-
let is_const_underscore = kw == T![const] && p.eat(UNDERSCORE);
17+
let is_const_underscore = kw == T![const] && p.eat(T![_]);
1818
if !is_const_underscore {
1919
name(p);
2020
}

0 commit comments

Comments
 (0)