Unnamed repository; edit this file 'description' to name the repository.
feat: add `use` type bound grammar
winstxnhdw 2024-07-24
parent eb5da56 · commit fa3484f
-rw-r--r--crates/syntax/rust.ungram1
-rw-r--r--crates/syntax/src/ast/generated/nodes.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/crates/syntax/rust.ungram b/crates/syntax/rust.ungram
index 000ac9c8f6..272796bb3b 100644
--- a/crates/syntax/rust.ungram
+++ b/crates/syntax/rust.ungram
@@ -629,6 +629,7 @@ TypeBoundList =
TypeBound =
Lifetime
| ('~' 'const' | 'const')? 'async'? '?'? Type
+| 'use' GenericParamList?
//************************//
// Patterns //
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs
index ceecffba5d..638f4867b8 100644
--- a/crates/syntax/src/ast/generated/nodes.rs
+++ b/crates/syntax/src/ast/generated/nodes.rs
@@ -1789,6 +1789,8 @@ pub struct TypeBound {
}
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]
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
@@ -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![~]) }
}