Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/rust.ungram')
-rw-r--r--crates/syntax/rust.ungram22
1 files changed, 18 insertions, 4 deletions
diff --git a/crates/syntax/rust.ungram b/crates/syntax/rust.ungram
index ea7ebd85b3..3603560d35 100644
--- a/crates/syntax/rust.ungram
+++ b/crates/syntax/rust.ungram
@@ -340,10 +340,10 @@ ExprStmt =
Expr =
ArrayExpr
+| AsmExpr
| AwaitExpr
| BinExpr
| BlockExpr
-| BoxExpr
| BreakExpr
| CallExpr
| CastExpr
@@ -351,6 +351,7 @@ Expr =
| ContinueExpr
| FieldExpr
| ForExpr
+| FormatArgsExpr
| IfExpr
| IndexExpr
| Literal
@@ -358,6 +359,7 @@ Expr =
| MacroExpr
| MatchExpr
| MethodCallExpr
+| OffsetOfExpr
| ParenExpr
| PathExpr
| PrefixExpr
@@ -373,6 +375,21 @@ Expr =
| LetExpr
| UnderscoreExpr
+OffsetOfExpr =
+ Attr* 'builtin' '#' 'offset_of' '(' Type ',' fields:(NameRef ('.' NameRef)* ) ')'
+
+AsmExpr =
+ Attr* 'builtin' '#' 'asm' '(' Expr ')'
+
+FormatArgsExpr =
+ Attr* 'builtin' '#' 'format_args' '('
+ template:Expr
+ (',' args:(FormatArgsArg (',' FormatArgsArg)* ','?)? )?
+ ')'
+
+FormatArgsArg =
+ (Name '=')? Expr
+
MacroExpr =
MacroCall
@@ -526,9 +543,6 @@ UnderscoreExpr =
AwaitExpr =
Attr* Expr '.' 'await'
-BoxExpr =
- Attr* 'box' Expr
-
//*************************//
// Types //
//*************************//