diff options
Diffstat (limited to 'crates/parser/src/grammar/items')
-rw-r--r-- | crates/parser/src/grammar/items/consts.rs | 2 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/traits.rs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/parser/src/grammar/items/consts.rs b/crates/parser/src/grammar/items/consts.rs index eb7d1f828..12130df40 100644 --- a/crates/parser/src/grammar/items/consts.rs +++ b/crates/parser/src/grammar/items/consts.rs | |||
@@ -13,7 +13,7 @@ pub(super) fn konst(p: &mut Parser, m: Marker) { | |||
13 | fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { | 13 | fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { |
14 | assert!(p.at(kw)); | 14 | assert!(p.at(kw)); |
15 | p.bump(kw); | 15 | p.bump(kw); |
16 | p.eat(T![mut]); // FIXME: validator to forbid const mut | 16 | p.eat(T![mut]); |
17 | 17 | ||
18 | // Allow `_` in place of an identifier in a `const`. | 18 | // Allow `_` in place of an identifier in a `const`. |
19 | let is_const_underscore = kw == T![const] && p.eat(T![_]); | 19 | let is_const_underscore = kw == T![const] && p.eat(T![_]); |
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index d076974ed..d3327271c 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs | |||
@@ -40,6 +40,10 @@ pub(super) fn impl_(p: &mut Parser) { | |||
40 | type_params::opt_generic_param_list(p); | 40 | type_params::opt_generic_param_list(p); |
41 | } | 41 | } |
42 | 42 | ||
43 | // test impl_def_const | ||
44 | // impl const Send for X {} | ||
45 | p.eat(T![const]); | ||
46 | |||
43 | // FIXME: never type | 47 | // FIXME: never type |
44 | // impl ! {} | 48 | // impl ! {} |
45 | 49 | ||