From fa3484f39fa18671e7fe0d6b464c7fb9cc81e3b1 Mon Sep 17 00:00:00 2001 From: winstxnhdw Date: Mon, 22 Jul 2024 00:00:59 +0100 Subject: [PATCH] feat: add `use` type bound grammar --- crates/syntax/rust.ungram | 1 + crates/syntax/src/ast/generated/nodes.rs | 4 ++++ 2 files changed, 5 insertions(+) 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 @@ -1788,6 +1788,8 @@ pub struct TypeBound { pub(crate) syntax: SyntaxNode, } impl TypeBound { + #[inline] + pub fn generic_param_list(&self) -> Option { support::child(&self.syntax) } #[inline] pub fn lifetime(&self) -> Option { support::child(&self.syntax) } #[inline] @@ -1799,6 +1801,8 @@ impl TypeBound { #[inline] pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } #[inline] + pub fn use_token(&self) -> Option { support::token(&self.syntax, T![use]) } + #[inline] pub fn tilde_token(&self) -> Option { support::token(&self.syntax, T![~]) } }