mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-25 05:23:12 +00:00
Parse associated return type bounds
This commit is contained in:
parent
d7d8971203
commit
fa2340a4df
12 changed files with 361 additions and 5 deletions
|
|
@ -51,7 +51,9 @@ TypeArg =
|
|||
Type
|
||||
|
||||
AssocTypeArg =
|
||||
NameRef GenericArgList? (':' TypeBoundList | ('=' Type | ConstArg))
|
||||
NameRef
|
||||
(GenericArgList | ParamList RetType?)?
|
||||
(':' TypeBoundList | ('=' Type | ConstArg))
|
||||
|
||||
LifetimeArg =
|
||||
Lifetime
|
||||
|
|
@ -581,7 +583,7 @@ ImplTraitType =
|
|||
'impl' TypeBoundList
|
||||
|
||||
DynTraitType =
|
||||
'dyn' TypeBoundList
|
||||
'dyn'? TypeBoundList
|
||||
|
||||
TypeBoundList =
|
||||
bounds:(TypeBound ('+' TypeBound)* '+'?)
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ impl ast::HasTypeBounds for AssocTypeArg {}
|
|||
impl AssocTypeArg {
|
||||
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
|
||||
pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
|
||||
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
|
||||
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
|
||||
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
|
||||
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
|
||||
pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue