Unnamed repository; edit this file 'description' to name the repository.
Update grammar
Bounds are CONSTNESS ASYNCNESS POLARITY
Michael Goulet 2024-02-16
parent 3e4deab · commit 36020bb
-rw-r--r--crates/syntax/rust.ungram2
-rw-r--r--crates/syntax/src/ast/generated/nodes.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/crates/syntax/rust.ungram b/crates/syntax/rust.ungram
index 36d677e151..c3d8e97c43 100644
--- a/crates/syntax/rust.ungram
+++ b/crates/syntax/rust.ungram
@@ -614,7 +614,7 @@ TypeBoundList =
TypeBound =
Lifetime
-| ('?' | '~' 'const')? Type
+| ('~' 'const' | 'const')? 'async'? '?'? Type
//************************//
// Patterns //
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs
index affcdc94d0..75971861aa 100644
--- a/crates/syntax/src/ast/generated/nodes.rs
+++ b/crates/syntax/src/ast/generated/nodes.rs
@@ -1410,9 +1410,10 @@ pub struct TypeBound {
}
impl TypeBound {
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
- pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
+ pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
+ pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}