1 // Stores definitions which must be used in multiple places
2 // See `cargo xtask codegen` (defined in xtasks/src/main.rs)
99 contextual_keywords: [
165 "RECORD_FIELD_PAT_LIST",
212 "RANGE_EXPR", // just weird
219 "RECORD_FIELD_DEF_LIST",
221 "TUPLE_FIELD_DEF_LIST",
226 "META_ITEM", // not an item actually
264 traits: [ "ModuleItemOwner", "FnDefOwner" ],
266 ("modules", "Module"),
277 options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
279 "RetType": (options: ["TypeRef"]),
297 options: ["RecordFieldDefList"],
299 "RecordFieldDefList": (collections: [("fields", "RecordFieldDef")]),
306 "TypeAscriptionOwner"
309 "TupleFieldDefList": (collections: [("fields", "TupleFieldDef")]),
310 "TupleFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]),
311 "EnumDef": ( traits: [
317 ], options: [["variant_list", "EnumVariantList"]] ),
318 "EnumVariantList": ( collections: [("variants", "EnumVariant")] ),
319 "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner", "AttrsOwner"], options: ["Expr"] ),
321 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeParamsOwner", "TypeBoundsOwner"],
322 options: ["ItemList"]
325 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ],
326 options: [ "ItemList" ]
329 collections: [("impl_items", "ImplItem")],
330 traits: [ "FnDefOwner", "ModuleItemOwner" ],
339 "TypeAscriptionOwner",
341 options: [ ["body","Expr"]],
350 "TypeAscriptionOwner",
352 options: [ ["body","Expr"]],
365 "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner", "AttrsOwner"]),
367 "ParenType": (options: ["TypeRef"]),
368 "TupleType": ( collections: [("fields", "TypeRef")] ),
370 "PathType": (options: ["Path"]),
371 "PointerType": (options: ["TypeRef"]),
372 "ArrayType": ( options: ["TypeRef", "Expr"] ),
373 "SliceType": ( options: ["TypeRef"] ),
374 "ReferenceType": (options: ["TypeRef"]),
375 "PlaceholderType": (),
376 "FnPointerType": (options: ["ParamList", "RetType"]),
377 "ForType": (options: ["TypeRef"]),
379 traits: ["TypeBoundsOwner"],
382 traits: ["TypeBoundsOwner"],
402 enum: ["StructDef", "EnumDef", "UnionDef"],
410 enum: ["StructDef", "UnionDef", "EnumDef", "FnDef", "TraitDef", "TypeAliasDef", "ImplBlock",
411 "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ],
412 traits: ["AttrsOwner"],
415 enum: ["FnDef", "TypeAliasDef", "ConstDef"],
416 traits: ["AttrsOwner"]
420 collections: [("exprs", "Expr")]
423 collections: [("exprs", "Expr")]
425 "ParenExpr": (options: ["Expr"]),
426 "PathExpr": (options: ["Path"]),
434 options: [ "Condition" ]
437 traits: ["LoopBodyOwner"],
440 options: [["body", "BlockExpr"]],
443 traits: ["LoopBodyOwner"],
446 ["iterable", "Expr"],
450 traits: ["LoopBodyOwner"],
451 options: [ "Condition" ]
454 "BreakExpr": (options: ["Expr"]),
459 "ReturnExpr": (options: ["Expr"]),
461 options: [ "Expr", "MatchArmList" ],
464 collections: [ ("arms", "MatchArm") ],
465 traits: [ "AttrsOwner" ]
469 [ "guard", "MatchGuard" ],
472 collections: [ ("pats", "Pat") ],
473 traits: [ "AttrsOwner" ]
475 "MatchGuard": (options: ["Expr"]),
476 "RecordLit": (options: ["Path", "RecordFieldList"]),
478 collections: [ ("fields", "RecordField") ],
479 options: [["spread", "Expr"]]
481 "RecordField": (options: ["NameRef", "Expr"]),
483 traits: ["ArgListOwner"],
487 traits: ["ArgListOwner"],
488 options: [ "Expr", "NameRef", "TypeArgList" ],
491 "FieldExpr": (options: ["Expr", "NameRef"]),
492 "AwaitExpr": (options: ["Expr"]),
493 "TryExpr": (options: ["Expr"]),
494 "CastExpr": (options: ["Expr", "TypeRef"]),
495 "RefExpr": (options: ["Expr"]),
496 "PrefixExpr": (options: ["Expr"]),
497 "BoxExpr": (options: ["Expr"]),
539 "RefPat": ( options: [ "Pat" ]),
540 "BoxPat": ( options: [ "Pat" ]),
543 traits: ["NameOwner"]
545 "PlaceholderPat": (),
547 "PathPat": ( options: [ "Path" ] ),
548 "RecordPat": ( options: ["RecordFieldPatList", "Path"] ),
549 "RecordFieldPatList": (
551 ("record_field_pats", "RecordFieldPat"),
552 ("bind_pats", "BindPat"),
556 traits: ["NameOwner"],
561 collections: [("args", "Pat")],
563 "TuplePat": ( collections: [("args", "Pat")] ),
566 "LiteralPat": (options: ["Literal"]),
589 traits: [ "NameOwner", "AttrsOwner","DocCommentsOwner" ],
590 options: [ "TokenTree", "Path" ],
592 "AttrInput": ( enum: [ "Literal", "TokenTree" ] ),
593 "Attr": ( options: [ "Path", [ "input", "AttrInput" ] ] ),
597 ("type_params", "TypeParam" ),
598 ("lifetime_params", "LifetimeParam" ),
602 options: [("default_type", "TypeRef")],
603 traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner"],
606 traits: ["AttrsOwner"],
615 ("bounds", "TypeBound"),
628 ("predicates", "WherePred"),
632 options: [ ["expr", "Expr"] ]
637 ["initializer", "Expr"],
640 "TypeAscriptionOwner",
644 options: [ "Pat", "Expr" ]
647 enum: ["ExprStmt", "LetStmt"],
652 ("statements", "Stmt"),
660 options: [ "SelfParam" ],
667 "TypeAscriptionOwner",
674 "TypeAscriptionOwner",
679 traits: ["AttrsOwner"],
680 options: [ "UseTree" ],
683 options: [ "Path", "UseTreeList", "Alias" ]
686 traits: ["NameOwner"],
689 collections: [("use_trees", "UseTree")]
692 traits: ["AttrsOwner"],
693 options: ["NameRef", "Alias"],
702 ["segment", "PathSegment"],
703 ["qualifier", "Path"],
707 options: [ "NameRef", "TypeArgList", "ParamList", "RetType", "PathType" ]
709 "TypeArgList": (collections: [
710 ("type_args", "TypeArg"),
711 ("lifetime_args", "LifetimeArg"),
712 ("assoc_type_args", "AssocTypeArg"),
714 "TypeArg": (options: ["TypeRef"]),
715 "AssocTypeArg": (options: ["NameRef", "TypeRef"]),
719 traits: [ "ModuleItemOwner", "FnDefOwner" ],
725 ("statements", "Stmt"),