1 // Stores definitions which must be used in multiple places
2 // See `cargo xtask codegen` (defined in xtasks/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" ],
401 traits: ["AttrsOwner"]
404 enum: ["FnDef", "TypeAliasDef", "ConstDef"]
408 collections: [("exprs", "Expr")]
411 collections: [("exprs", "Expr")]
413 "ParenExpr": (options: ["Expr"]),
414 "PathExpr": (options: ["Path"]),
422 options: [ "Condition" ]
425 traits: ["LoopBodyOwner"],
428 options: [["body", "BlockExpr"]],
431 traits: ["LoopBodyOwner"],
434 ["iterable", "Expr"],
438 traits: ["LoopBodyOwner"],
439 options: [ "Condition" ]
442 "BreakExpr": (options: ["Expr"]),
447 "ReturnExpr": (options: ["Expr"]),
449 options: [ "Expr", "MatchArmList" ],
452 collections: [ ("arms", "MatchArm") ],
453 traits: [ "AttrsOwner" ]
457 [ "guard", "MatchGuard" ],
460 collections: [ ("pats", "Pat") ],
461 traits: [ "AttrsOwner" ]
463 "MatchGuard": (options: ["Expr"]),
464 "RecordLit": (options: ["Path", "RecordFieldList"]),
466 collections: [ ("fields", "RecordField") ],
467 options: [["spread", "Expr"]]
469 "RecordField": (options: ["NameRef", "Expr"]),
471 traits: ["ArgListOwner"],
475 traits: ["ArgListOwner"],
476 options: [ "Expr", "NameRef", "TypeArgList" ],
479 "FieldExpr": (options: ["Expr", "NameRef"]),
480 "AwaitExpr": (options: ["Expr"]),
481 "TryExpr": (options: ["Expr"]),
482 "CastExpr": (options: ["Expr", "TypeRef"]),
483 "RefExpr": (options: ["Expr"]),
484 "PrefixExpr": (options: ["Expr"]),
485 "BoxExpr": (options: ["Expr"]),
527 "RefPat": ( options: [ "Pat" ]),
528 "BoxPat": ( options: [ "Pat" ]),
531 traits: ["NameOwner"]
533 "PlaceholderPat": (),
535 "PathPat": ( options: [ "Path" ] ),
536 "RecordPat": ( options: ["RecordFieldPatList", "Path"] ),
537 "RecordFieldPatList": (
539 ("record_field_pats", "RecordFieldPat"),
540 ("bind_pats", "BindPat"),
544 traits: ["NameOwner"],
549 collections: [("args", "Pat")],
551 "TuplePat": ( collections: [("args", "Pat")] ),
554 "LiteralPat": (options: ["Literal"]),
577 traits: [ "NameOwner", "AttrsOwner","DocCommentsOwner" ],
578 options: [ "TokenTree", "Path" ],
580 "AttrInput": ( enum: [ "Literal", "TokenTree" ] ),
581 "Attr": ( options: [ "Path", [ "input", "AttrInput" ] ] ),
585 ("type_params", "TypeParam" ),
586 ("lifetime_params", "LifetimeParam" ),
589 "TypeParam": ( traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner", "DefaultTypeParamOwner"] ),
591 traits: ["AttrsOwner"],
600 ("bounds", "TypeBound"),
613 ("predicates", "WherePred"),
617 options: [ ["expr", "Expr"] ]
622 ["initializer", "Expr"],
625 "TypeAscriptionOwner",
629 options: [ "Pat", "Expr" ]
632 enum: ["ExprStmt", "LetStmt"],
637 ("statements", "Stmt"),
644 options: [ "SelfParam" ],
651 "TypeAscriptionOwner",
658 "TypeAscriptionOwner",
663 traits: ["AttrsOwner"],
664 options: [ "UseTree" ],
667 options: [ "Path", "UseTreeList", "Alias" ]
670 traits: ["NameOwner"],
673 collections: [("use_trees", "UseTree")]
676 traits: ["AttrsOwner"],
677 options: ["NameRef", "Alias"],
686 ["segment", "PathSegment"],
687 ["qualifier", "Path"],
691 options: [ "NameRef", "TypeArgList", "ParamList", "RetType", "PathType" ]
693 "TypeArgList": (collections: [
694 ("type_args", "TypeArg"),
695 ("lifetime_args", "LifetimeArg"),
696 ("assoc_type_args", "AssocTypeArg"),
698 "TypeArg": (options: ["TypeRef"]),
699 "AssocTypeArg": (options: ["NameRef", "TypeRef"]),
703 traits: [ "ModuleItemOwner", "FnDefOwner" ],
709 ("statements", "Stmt"),