mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-28 04:45:05 +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();
|
let m = p.start();
|
||||||
p.bump();
|
p.bump();
|
||||||
if p.eat(COLON) {
|
if p.eat(COLON) {
|
||||||
|
// test type_param_bounds
|
||||||
|
// struct S<T: 'a + ?Sized + (Copy)>;
|
||||||
loop {
|
loop {
|
||||||
let has_paren = p.eat(L_PAREN);
|
let has_paren = p.eat(L_PAREN);
|
||||||
p.eat(QUESTION);
|
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) {
|
if p.at(EQ) {
|
||||||
|
p.bump();
|
||||||
types::type_(p)
|
types::type_(p)
|
||||||
}
|
}
|
||||||
m.complete(p, TYPE_PARAM);
|
m.complete(p, TYPE_PARAM);
|
||||||
|
|
Loading…
Reference in a new issue