mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
feat: add use
type bound grammar
This commit is contained in:
parent
eb5da56d83
commit
fa3484f39f
2 changed files with 5 additions and 0 deletions
|
@ -629,6 +629,7 @@ TypeBoundList =
|
|||
TypeBound =
|
||||
Lifetime
|
||||
| ('~' 'const' | 'const')? 'async'? '?'? Type
|
||||
| 'use' GenericParamList?
|
||||
|
||||
//************************//
|
||||
// Patterns //
|
||||
|
|
|
@ -1788,6 +1788,8 @@ pub struct TypeBound {
|
|||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl TypeBound {
|
||||
#[inline]
|
||||
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
|
||||
#[inline]
|
||||
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
|
||||
#[inline]
|
||||
|
@ -1799,6 +1801,8 @@ impl TypeBound {
|
|||
#[inline]
|
||||
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
||||
#[inline]
|
||||
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
|
||||
#[inline]
|
||||
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue