[][src]Module syntax::ast

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Re-exports

pub use self::UnsafeSource::*;
pub use self::GenericArgs::*;
pub use util::parser::ExprPrecedence;

Structs

AngleBracketedArgs [
Experimental
]

A path like Foo<'a, T>

AnonConst [
Experimental
]

A constant (expression) that's not an item or associated item, but needs its own DefId for type-checking, const-eval, etc. These are usually found nested inside types (e.g. array lengths) or expressions (e.g. repeat counts), and also used to define explicit discriminant values for enum variants.

Arg [
Experimental
]

An argument in a function header.

Arm [
Experimental
]

An arm of a 'match'.

AttrId [
Experimental
]
Attribute [
Experimental
]

Meta-data associated with an item Doc-comments are promoted to attributes that have is_sugared_doc = true

BareFnTy [
Experimental
]
Block [
Experimental
]

A Block ({ .. }).

Crate [
Experimental
]
EnumDef [
Experimental
]
Expr [
Experimental
]

An expression

Field [
Experimental
]
FieldPat [
Experimental
]

A single field in a struct pattern

FnDecl [
Experimental
]

Header (not the body) of a function declaration.

FnHeader [
Experimental
]

A function header

ForeignItem [
Experimental
]
ForeignMod [
Experimental
]

Foreign module declaration.

GenericParam [
Experimental
]
Generics [
Experimental
]

Represents lifetime, type and const parameters attached to a declaration of a function, enum, trait, etc.

GlobalAsm [
Experimental
]

Global inline assembly

Ident [
Experimental
]
ImplItem [
Experimental
]
InlineAsm [
Experimental
]

Inline assembly.

InlineAsmOutput [
Experimental
]

Inline assembly.

Item [
Experimental
]

An item

Label [
Experimental
]
Lifetime [
Experimental
]
Local [
Experimental
]

Local represents a let statement, e.g., let <pat>:<ty> = <expr>;

Mac_ [
Experimental
]

Represents a macro invocation. The Path indicates which macro is being invoked, and the vector of token-trees contains the source of the macro invocation.

MacroDef [
Experimental
]
MetaItem [
Experimental
]

A spanned compile-time attribute item.

MethodSig [
Experimental
]

Represents a method's signature in a trait declaration, or in an implementation.

Mod [
Experimental
]

Module declaration.

MutTy [
Experimental
]
Name [
Experimental
]

A symbol is an interned or gensymed string.

NodeId [
Experimental
]
ParenthesisedArgs [
Experimental
]

A path like Foo(A,B) -> C

Pat [
Experimental
]
Path [
Experimental
]

A "Path" is essentially Rust's notion of a name.

PathSegment [
Experimental
]

A segment of a path: an identifier, an optional lifetime, and a set of types.

PolyTraitRef [
Experimental
]
QSelf [
Experimental
]

The explicit Self type in a "qualified path". The actual path, including the trait and the associated item, is stored separately. position represents the index of the associated item qualified with this Self type.

Stmt [
Experimental
]

A statement

StructField [
Experimental
]

Field of a struct.

TraitItem [
Experimental
]

Represents an item declaration within a trait declaration, possibly including a default implementation. A trait item is either required (meaning it doesn't have an implementation, just a signature) or provided (meaning it has a default implementation).

TraitRef [
Experimental
]

TraitRef's appear in impls.

Ty [
Experimental
]
TypeBinding [
Experimental
]
UseTree [
Experimental
]

A tree of paths sharing common prefixes. Used in use items both at top-level and inside of braces in import groups.

Variant_ [
Experimental
]
WhereBoundPredicate [
Experimental
]

A type bound.

WhereClause [
Experimental
]

A where clause in a definition

WhereEqPredicate [
Experimental
]

An equality predicate (unsupported).

WhereRegionPredicate [
Experimental
]

A lifetime predicate.

Enums

AsmDialect [
Experimental
]

Inline assembly dialect.

AttrStyle [
Experimental
]

Distinguishes between Attributes that decorate items and Attributes that are contained as statements within items. These two cases need to be distinguished for pretty-printing.

BinOpKind [
Experimental
]
BindingMode [
Experimental
]
BlockCheckMode [
Experimental
]
CaptureBy [
Experimental
]

A capture clause

Constness [
Experimental
]
CrateSugar [
Experimental
]
Defaultness [
Experimental
]
ExprKind [
Experimental
]
FloatTy [
Experimental
]
ForeignItemKind [
Experimental
]

An item within an extern block

FunctionRetTy [
Experimental
]
GenericArg [
Experimental
]
GenericArgs [
Experimental
]

Arguments of a path segment.

GenericBound [
Experimental
]

The AST represents all type param bounds as types. typeck::collect::compute_bounds matches these against the "special" built-in traits (see middle::lang_items) and detects Copy, Send and Sync.

GenericParamKind [
Experimental
]
Guard [
Experimental
]
ImplItemKind [
Experimental
]
ImplPolarity [
Experimental
]
IntTy [
Experimental
]
IsAsync [
Experimental
]
IsAuto [
Experimental
]

Is the trait definition an auto trait?

ItemKind [
Experimental
]
LitIntType [
Experimental
]
LitKind [
Experimental
]

Literal kind.

MacDelimiter [
Experimental
]
MacStmtStyle [
Experimental
]
MetaItemKind [
Experimental
]

A compile-time attribute item.

Movability [
Experimental
]

The movability of a generator / closure literal

Mutability [
Experimental
]
NestedMetaItemKind [
Experimental
]

Possible values inside of compile-time attribute lists.

PatKind [
Experimental
]
RangeEnd [
Experimental
]
RangeLimits [
Experimental
]

Limit types of a range (inclusive or exclusive)

RangeSyntax [
Experimental
]
SelfKind [
Experimental
]

Alternative representation for Args describing self parameter of methods.

StmtKind [
Experimental
]
StrStyle [
Experimental
]
TraitBoundModifier [
Experimental
]

A modifier on a bound, currently this is only used for ?Sized, where the modifier is Maybe. Negative bounds should also be handled here.

TraitItemKind [
Experimental
]
TraitObjectSyntax [
Experimental
]

Syntax used to declare a trait object.

TyKind [
Experimental
]

The different kinds of types recognized by the compiler

UintTy [
Experimental
]
UnOp [
Experimental
]
UnsafeSource [
Experimental
]
Unsafety [
Experimental
]
UseTreeKind [
Experimental
]

Part of use item to the right of its prefix.

VariantData [
Experimental
]

Fields and Ids of enum variants and structs

VisibilityKind [
Experimental
]
WherePredicate [
Experimental
]

A single predicate in a where clause

Constants

CRATE_NODE_ID [
Experimental
]

Node id used to represent the root of the crate.

DUMMY_NODE_ID [
Experimental
]

When parsing and doing expansions, we initially give all AST nodes this AST node value. Then later, in the renumber pass, we renumber them to have small, positive ids.

Type Definitions

BinOp [
Experimental
]
CrateConfig [
Experimental
]

The set of MetaItems that define the compilation environment of the crate, used to drive conditional compilation

ExplicitSelf [
Experimental
]
GenericBounds [
Experimental
]
Lit [
Experimental
]

A literal

Mac [
Experimental
]
NestedMetaItem [
Experimental
]

A spanned compile-time attribute list item.

SpannedIdent [
Experimental
]
Variant [
Experimental
]
Visibility [
Experimental
]