Module syntax::ast [] [src]

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

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

Reexports

pub use self::TyParamBound::*;
pub use self::UnsafeSource::*;
pub use self::ViewPath_::*;
pub use self::PathParameters::*;

Structs

AngleBracketedParameterData [
Experimental
]

A path like Foo<'a, T>

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.

ForeignItem [
Experimental
]
ForeignMod [
Experimental
]

Foreign module declaration.

Generics [
Experimental
]

Represents lifetimes and type 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

Lifetime [
Experimental
]
LifetimeDef [
Experimental
]

A lifetime definition, e.g. 'a: 'b+'c+'d

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
]
ParenthesizedParameterData [
Experimental
]

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

Pat [
Experimental
]
Path [
Experimental
]

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

PathListItem_ [
Experimental
]
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.

ThinVec [
Experimental
]

A vector type optimized for cases where this size is usually 0 (c.f. SmallVector). The Option<Box<..>> wrapping allows us to represent a zero sized vector with None, which uses only a single (null) pointer.

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
]
TyParam [
Experimental
]
TypeBinding [
Experimental
]
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
]
Defaultness [
Experimental
]
ExprKind [
Experimental
]
FloatTy [
Experimental
]
ForeignItemKind [
Experimental
]

An item within an extern block

FunctionRetTy [
Experimental
]
ImplItemKind [
Experimental
]
ImplPolarity [
Experimental
]
IntTy [
Experimental
]
ItemKind [
Experimental
]
LitIntType [
Experimental
]
LitKind [
Experimental
]

Literal kind.

MacStmtStyle [
Experimental
]
MetaItemKind [
Experimental
]

A compile-time attribute item.

Mutability [
Experimental
]
NestedMetaItemKind [
Experimental
]

Possible values inside of compile-time attribute lists.

PatKind [
Experimental
]
PathParameters [
Experimental
]

Parameters of a path segment.

RangeEnd [
Experimental
]
RangeLimits [
Experimental
]

Limit types of a range (inclusive or exclusive)

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
]
TyKind [
Experimental
]

The different kinds of types recognized by the compiler

TyParamBound [
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.

UintTy [
Experimental
]
UnOp [
Experimental
]
UnsafeSource [
Experimental
]
Unsafety [
Experimental
]
VariantData [
Experimental
]

Fields and Ids of enum variants and structs

ViewPath_ [
Experimental
]
Visibility [
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
]
Lit [
Experimental
]

A literal

Mac [
Experimental
]
NestedMetaItem [
Experimental
]

A spanned compile-time attribute list item.

PathListItem [
Experimental
]
SpannedIdent [
Experimental
]
TyParamBounds [
Experimental
]
Variant [
Experimental
]
ViewPath [
Experimental
]