Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3a2f250

Browse files
committed
feat: add use type bound grammar
1 parent 9751cbc commit 3a2f250

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/tools/rust-analyzer/crates/syntax/rust.ungram

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ TypeBoundList =
629629
TypeBound =
630630
Lifetime
631631
| ('~' 'const' | 'const')? 'async'? '?'? Type
632+
| 'use' GenericParamList?
632633

633634
//************************//
634635
// Patterns //

src/tools/rust-analyzer/crates/syntax/src/ast/generated/nodes.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,8 @@ pub struct TypeBound {
17881788
pub(crate) syntax: SyntaxNode,
17891789
}
17901790
impl TypeBound {
1791+
#[inline]
1792+
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
17911793
#[inline]
17921794
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
17931795
#[inline]
@@ -1799,6 +1801,8 @@ impl TypeBound {
17991801
#[inline]
18001802
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
18011803
#[inline]
1804+
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
1805+
#[inline]
18021806
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
18031807
}
18041808

0 commit comments

Comments
 (0)