1 // Stores definitions which must be used in multiple places
2 // See `cargo gen-syntax` (defined in crates/tools/src/main.rs)
99 contextual_keywords: [
164 "RECORD_FIELD_PAT_LIST",
211 "RANGE_EXPR", // just weird
218 "RECORD_FIELD_DEF_LIST",
220 "TUPLE_FIELD_DEF_LIST",
225 "META_ITEM", // not an item actually
263 traits: [ "ModuleItemOwner", "FnDefOwner" ],
265 ("modules", "Module"),
276 options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
278 "RetType": (options: ["TypeRef"]),
288 "RecordFieldDefList": (collections: [("fields", "RecordFieldDef")]),
295 "TypeAscriptionOwner"
298 "TupleFieldDefList": (collections: [("fields", "TupleFieldDef")]),
299 "TupleFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]),
300 "EnumDef": ( traits: [
306 ], options: [["variant_list", "EnumVariantList"]] ),
307 "EnumVariantList": ( collections: [("variants", "EnumVariant")] ),
308 "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner", "AttrsOwner"], options: ["Expr"] ),
310 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeParamsOwner", "TypeBoundsOwner"],
311 options: ["ItemList"]
314 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ],
315 options: [ "ItemList" ]
318 collections: [("impl_items", "ImplItem")],
319 traits: [ "FnDefOwner", "ModuleItemOwner" ],
328 "TypeAscriptionOwner",
330 options: [ ["body","Expr"]],
339 "TypeAscriptionOwner",
341 options: [ ["body","Expr"]],
354 "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner", "AttrsOwner"]),
356 "ParenType": (options: ["TypeRef"]),
357 "TupleType": ( collections: [("fields", "TypeRef")] ),
359 "PathType": (options: ["Path"]),
360 "PointerType": (options: ["TypeRef"]),
361 "ArrayType": ( options: ["TypeRef", "Expr"] ),
362 "SliceType": ( options: ["TypeRef"] ),
363 "ReferenceType": (options: ["TypeRef"]),
364 "PlaceholderType": (),
365 "FnPointerType": (options: ["ParamList", "RetType"]),
366 "ForType": (options: ["TypeRef"]),
368 traits: ["TypeBoundsOwner"],
371 traits: ["TypeBoundsOwner"],
391 enum: ["StructDef", "EnumDef"],
399 enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeAliasDef", "ImplBlock",
400 "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ]
403 enum: ["FnDef", "TypeAliasDef", "ConstDef"]
407 collections: [("exprs", "Expr")]
410 collections: [("exprs", "Expr")]
412 "ParenExpr": (options: ["Expr"]),
413 "PathExpr": (options: ["Path"]),
421 options: [ "Condition" ]
424 traits: ["LoopBodyOwner"],
427 options: [["body", "BlockExpr"]],
430 traits: ["LoopBodyOwner"],
433 ["iterable", "Expr"],
437 traits: ["LoopBodyOwner"],
438 options: [ "Condition" ]
441 "BreakExpr": (options: ["Expr"]),
446 "ReturnExpr": (options: ["Expr"]),
448 options: [ "Expr", "MatchArmList" ],
451 collections: [ ("arms", "MatchArm") ],
452 traits: [ "AttrsOwner" ]
456 [ "guard", "MatchGuard" ],
459 collections: [ ("pats", "Pat") ],
460 traits: [ "AttrsOwner" ]
462 "MatchGuard": (options: ["Expr"]),
463 "RecordLit": (options: ["Path", "RecordFieldList"]),
465 collections: [ ("fields", "RecordField") ],
466 options: [["spread", "Expr"]]
468 "RecordField": (options: ["NameRef", "Expr"]),
470 traits: ["ArgListOwner"],
474 traits: ["ArgListOwner"],
475 options: [ "Expr", "NameRef", "TypeArgList" ],
478 "FieldExpr": (options: ["Expr", "NameRef"]),
479 "AwaitExpr": (options: ["Expr"]),
480 "TryExpr": (options: ["Expr"]),
481 "CastExpr": (options: ["Expr", "TypeRef"]),
482 "RefExpr": (options: ["Expr"]),
483 "PrefixExpr": (options: ["Expr"]),
484 "BoxExpr": (options: ["Expr"]),
526 "RefPat": ( options: [ "Pat" ]),
527 "BoxPat": ( options: [ "Pat" ]),
530 traits: ["NameOwner"]
532 "PlaceholderPat": (),
534 "PathPat": ( options: [ "Path" ] ),
535 "RecordPat": ( options: ["RecordFieldPatList", "Path"] ),
536 "RecordFieldPatList": (
538 ("record_field_pats", "RecordFieldPat"),
539 ("bind_pats", "BindPat"),
543 traits: ["NameOwner"],
548 collections: [("args", "Pat")],
550 "TuplePat": ( collections: [("args", "Pat")] ),
553 "LiteralPat": (options: ["Literal"]),
576 traits: [ "NameOwner", "AttrsOwner","DocCommentsOwner" ],
577 options: [ "TokenTree", "Path" ],
579 "AttrInput": ( enum: [ "Literal", "TokenTree" ] ),
580 "Attr": ( options: [ "Path", [ "input", "AttrInput" ] ] ),
584 ("type_params", "TypeParam" ),
585 ("lifetime_params", "LifetimeParam" ),
588 "TypeParam": ( traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner", "DefaultTypeParamOwner"] ),
590 traits: ["AttrsOwner"],
599 ("bounds", "TypeBound"),
612 ("predicates", "WherePred"),
616 options: [ ["expr", "Expr"] ]
621 ["initializer", "Expr"],
624 "TypeAscriptionOwner",
628 options: [ "Pat", "Expr" ]
631 enum: ["ExprStmt", "LetStmt"],
636 ("statements", "Stmt"),
643 options: [ "SelfParam" ],
650 "TypeAscriptionOwner",
657 "TypeAscriptionOwner",
662 traits: ["AttrsOwner"],
663 options: [ "UseTree" ],
666 options: [ "Path", "UseTreeList", "Alias" ]
669 traits: ["NameOwner"],
672 collections: [("use_trees", "UseTree")]
675 traits: ["AttrsOwner"],
676 options: ["NameRef", "Alias"],
685 ["segment", "PathSegment"],
686 ["qualifier", "Path"],
690 options: [ "NameRef", "TypeArgList", "ParamList", "RetType", "PathType" ]
692 "TypeArgList": (collections: [
693 ("type_args", "TypeArg"),
694 ("lifetime_args", "LifetimeArg"),
695 ("assoc_type_args", "AssocTypeArg"),
697 "TypeArg": (options: ["TypeRef"]),
698 "AssocTypeArg": (options: ["NameRef", "TypeRef"]),
702 traits: [ "ModuleItemOwner", "FnDefOwner" ],
708 ("statements", "Stmt"),