Crate unrest_tmp_syn Copy item path Source delimited tokens Discrete tokens that can be parsed out by synom. Abi AngleBracketedParameterData A path like Foo<'a, T>
Attribute Doc-comments are promoted to attributes that have is_sugared_doc
= true BareFnArg An argument in a function type. BareFnTy BodyEnum It’s an enum. BodyStruct It’s a struct. BoundLifetimes A set of bound lifetimes, e.g. for<'a, 'b, 'c>
DeriveInput Struct or enum sent to a proc_macro_derive
macro. Expr An expression. ExprAddrOf A referencing operation (&a
or &mut a
) ExprArray An array, e.g. [a, b, c, d]
. ExprAssign An assignment (a = foo()
) ExprAssignOp An assignment with an operator ExprBinary A binary operation, e.g. a + b
, a * b
. ExprBlock A block ({ ... }
or unsafe { ... }
) ExprBox A box x
expression. ExprBreak A break
, with an optional label to break, and an optional expression ExprCall A function call. ExprCast A cast, e.g. foo as f64
. ExprCatch A catch expression. ExprClosure A closure (for example, move |a, b, c| a + b + c
) ExprContinue A continue
, with an optional label ExprField Access of a named struct field (obj.foo
) ExprForLoop A for loop, with an optional label. ExprGroup No-op: used solely so we can pretty-print faithfully ExprIf An if
block, with an optional else block ExprIfLet An if let
expression with an optional else block ExprInPlace E.g. ‘place <- val’ or in place { val }
. ExprIndex An indexing operation (foo[2]
) ExprLoop Conditionless loop with an optional label. ExprMatch A match
block. ExprMethodCall A method call (x.foo::<Bar, Baz>(a, b, c, d)
) ExprParen No-op: used solely so we can pretty-print faithfully ExprPath Variable reference, possibly containing ::
and/or type
parameters, e.g. foo::bar::. ExprRange A range (1..2
, 1..
, ..2
, 1...2
, 1...
, ...2
) ExprRepeat An array literal constructed from one repeated element. ExprRet A return
, with an optional value to be returned ExprStruct A struct literal expression. ExprTry expr?
ExprTup A tuple, e.g. (a, b, c, d)
. ExprTupField Access of an unnamed field of a struct or tuple-struct ExprType A type ascription, e.g. foo: f64
. ExprUnary A unary operation, e.g. !x
, *x
. ExprWhile A while loop, with an optional label ExprWhileLet A while-let loop, with an optional label. Field A field of a struct or enum variant. Generics Represents lifetimes and type parameters attached to a declaration
of a function, enum, trait, etc. Ident A word of Rust code, such as a keyword or variable name. ImplGenerics Returned by Generics::split_for_impl
. Lifetime LifetimeDef A lifetime definition, e.g. 'a: 'b+'c+'d
Lit Mac 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. MetaItemList List meta item. MetaNameValue Name-value meta item. MutTy ParenthesizedParameterData A path like Foo(A,B) -> C
ParseError Path A “Path” is essentially Rust’s notion of a name. PathSegment A segment of a path: an identifier, an optional lifetime, and a set of types. PathTokens PolyTraitRef QSelf 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. Span TokenTree Turbofish Returned by TyGenerics::as_turbofish
. TyArray A fixed length array ([T; n]
) TyBareFn A bare function (e.g. fn(usize) -> bool
) TyGenerics Returned by Generics::split_for_impl
. TyGroup No-op: kept solely so that we can pretty-print faithfully TyImplTrait An impl Bound1 + Bound2 + Bound3
type
where Bound
is a trait or a lifetime. TyInfer TyKind::Infer means the type should be inferred instead of it having been
specified. This can appear anywhere in a type. TyNever The never type (!
) TyParam A generic type parameter, e.g. T: Into<String>
. TyParen No-op; kept solely so that we can pretty-print faithfully TyPath A path (module::module::...::Type
), optionally
“qualified”, e.g. <Vec<T> as SomeTrait>::SomeType
. TyPtr A raw pointer (*const T
or *mut T
) TyRptr A reference (&'a T
or &'a mut T
) TySlice A variable-length array ([T]
) TyTraitObject A trait object type Bound1 + Bound2 + Bound3
where Bound
is a trait or a lifetime. TyTup A tuple ((A, B, C, D, ...)
) TypeBinding Bind a type to an associated type: A=Foo
. Variant An enum variant. VisCrate Crate-visible, i.e. pub(crate)
. VisInherited Inherited, i.e. private. VisPublic Public, i.e. pub
. VisRestricted Restricted, e.g. pub(self)
or pub(super)
or pub(in some::module)
. WhereBoundPredicate A type binding, e.g. for<'c> Foo: Send+Clone+'c
WhereClause A where
clause in a definition WhereEqPredicate An equality predicate (unsupported) WhereRegionPredicate A lifetime predicate, e.g. 'a: 'b+'c
AttrStyle 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. BinOp Body Body of a derived struct or enum. ExprKind FunctionRetTy LitKind MetaItem A compile-time attribute item. Mutability NestedMetaItem Possible values inside of compile-time attribute lists. PathParameters Parameters of a path segment. TraitBoundModifier A modifier on a bound, currently this is only used for ?Sized
, where the
modifier is Maybe
. Negative bounds should also be handled here. Ty The different kinds of types recognized by the compiler TyParamBound 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. UnOp Unsafety VariantData Data stored within an enum variant or struct. Visibility Visibility level of an item. WherePredicate A single predicate in a where
clause parse Parse tokens of source code into the chosen syn data type. parse_str Parse a string of Rust code into the chosen syn data type.