mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Allow true
and false
keywords in const generics
This commit is contained in:
parent
77362c7173
commit
dcb4c0ada6
3 changed files with 25 additions and 11 deletions
|
@ -26,7 +26,7 @@ pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) {
|
|||
}
|
||||
|
||||
// test type_arg
|
||||
// type A = B<'static, i32, 1, { 2 }, Item=u64>;
|
||||
// type A = B<'static, i32, 1, { 2 }, Item=u64, true, false>;
|
||||
fn generic_arg(p: &mut Parser) {
|
||||
let m = p.start();
|
||||
match p.current() {
|
||||
|
@ -55,6 +55,10 @@ fn generic_arg(p: &mut Parser) {
|
|||
expressions::literal(p);
|
||||
m.complete(p, CONST_ARG);
|
||||
}
|
||||
TRUE_KW | FALSE_KW => {
|
||||
expressions::literal(p);
|
||||
m.complete(p, CONST_ARG);
|
||||
}
|
||||
_ => {
|
||||
types::type_(p);
|
||||
m.complete(p, TYPE_ARG);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue