diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 375df301f3..1c1dec80a5 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -114,6 +114,11 @@ Union = Attr* Visibility? 'union' Name GenericParamList? WhereClause? RecordFieldList +AdtDef = + Struct +| Enum +| Union + Const = Attr* Visibility? 'default'? 'const' (Name | '_') ':' ty:TypeRef '=' body:Expr ';' @@ -183,6 +188,21 @@ Visibility = Attr = '#' '!'? '[' Path ('=' Literal | TokenTree)? ']' +TypeRef = + ParenType +| TupleType +| NeverType +| PathType +| PointerType +| ArrayType +| SliceType +| ReferenceType +| PlaceholderType +| FnPointerType +| ForType +| ImplTraitType +| DynTraitType + ParenType = '(' ty:TypeRef ')' @@ -469,26 +489,6 @@ LifetimeArg = ConstArg = Literal | BlockExpr BlockExpr -AdtDef = - Struct -| Enum -| Union - -TypeRef = - ParenType -| TupleType -| NeverType -| PathType -| PointerType -| ArrayType -| SliceType -| ReferenceType -| PlaceholderType -| FnPointerType -| ForType -| ImplTraitType -| DynTraitType - Stmt = LetStmt | ExprStmt