diff options
Diffstat (limited to 'crates/parser/src/grammar/type_params.rs')
-rw-r--r-- | crates/parser/src/grammar/type_params.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs index 3de5248da..b1f979281 100644 --- a/crates/parser/src/grammar/type_params.rs +++ b/crates/parser/src/grammar/type_params.rs | |||
@@ -70,6 +70,16 @@ fn const_param(p: &mut Parser, m: Marker) { | |||
70 | p.bump(T![const]); | 70 | p.bump(T![const]); |
71 | name(p); | 71 | name(p); |
72 | types::ascription(p); | 72 | types::ascription(p); |
73 | |||
74 | // test const_param_defaults | ||
75 | // struct A<const N: i32 = -1>; | ||
76 | // struct B<const N: i32 = {}>; | ||
77 | // struct C<const N: i32 = some::CONST>; | ||
78 | if p.at(T![=]) { | ||
79 | p.bump(T![=]); | ||
80 | type_args::const_arg(p); | ||
81 | } | ||
82 | |||
73 | m.complete(p, CONST_PARAM); | 83 | m.complete(p, CONST_PARAM); |
74 | } | 84 | } |
75 | 85 | ||