mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
type param defaults
This commit is contained in:
parent
72d49c5a10
commit
27a40e0a88
1 changed files with 5 additions and 0 deletions
|
@ -40,6 +40,8 @@ pub(super) fn list(p: &mut Parser) {
|
|||
let m = p.start();
|
||||
p.bump();
|
||||
if p.eat(COLON) {
|
||||
// test type_param_bounds
|
||||
// struct S<T: 'a + ?Sized + (Copy)>;
|
||||
loop {
|
||||
let has_paren = p.eat(L_PAREN);
|
||||
p.eat(QUESTION);
|
||||
|
@ -61,7 +63,10 @@ pub(super) fn list(p: &mut Parser) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// test type_param_default
|
||||
// struct S<T = i32>;
|
||||
if p.at(EQ) {
|
||||
p.bump();
|
||||
types::type_(p)
|
||||
}
|
||||
m.complete(p, TYPE_PARAM);
|
||||
|
|
Loading…
Reference in a new issue