mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +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 =
|
TypeBound =
|
||||||
Lifetime
|
Lifetime
|
||||||
| ('~' 'const' | 'const')? 'async'? '?'? Type
|
| ('~' 'const' | 'const')? 'async'? '?'? Type
|
||||||
|
| 'use' GenericParamList?
|
||||||
|
|
||||||
//************************//
|
//************************//
|
||||||
// Patterns //
|
// Patterns //
|
||||||
|
|
|
@ -1788,6 +1788,8 @@ pub struct TypeBound {
|
||||||
pub(crate) syntax: SyntaxNode,
|
pub(crate) syntax: SyntaxNode,
|
||||||
}
|
}
|
||||||
impl TypeBound {
|
impl TypeBound {
|
||||||
|
#[inline]
|
||||||
|
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
|
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -1799,6 +1801,8 @@ impl TypeBound {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
||||||
#[inline]
|
#[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![~]) }
|
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue