rustc_ast - Rust (original) (raw)
Expand description
The Rust Abstract Syntax Tree (AST).
§Note
This API is completely unstable and subject to change.
pub use self::ast_traits::[AstDeref](ast%5Ftraits/trait.AstDeref.html "trait rustc_ast::ast_traits::AstDeref");
pub use self::ast_traits::[AstNodeWrapper](ast%5Ftraits/struct.AstNodeWrapper.html "struct rustc_ast::ast_traits::AstNodeWrapper");
pub use self::ast_traits::[HasAttrs](ast%5Ftraits/trait.HasAttrs.html "trait rustc_ast::ast_traits::HasAttrs");
pub use self::ast_traits::[HasNodeId](ast%5Ftraits/trait.HasNodeId.html "trait rustc_ast::ast_traits::HasNodeId");
pub use self::ast_traits::[HasTokens](ast%5Ftraits/trait.HasTokens.html "trait rustc_ast::ast_traits::HasTokens");
pub use self::[ast](ast/index.html "mod rustc_ast::ast")::*;
The Rust abstract syntax tree module.
A set of traits implemented for various AST nodes, typically those used in AST fragments during macro expansion. The traits are not implemented exhaustively, only when actually necessary.
Functions dealing with attributes and meta items.
Definitions shared by macros / syntax extensions and e.g. rustc_middle
.
A MutVisitor
represents an AST modification; it accepts an AST piece and mutates it in place. So, for instance, macro expansion is a MutVisitor
that walks over an AST and modifies it.
The AST pointer.
Token Streams
AST walker. Each overridden visit method has full control over what happens with its node, it can do its own traversal of the node’s children, call visit::walk_*
to apply the default traversal algorithm, or prevent deeper traversal by doing nothing.
Requirements for a StableHashingContext
to be used in this crate. This is a hack to allow using the HashStable_Generic
derive macro instead of implementing everything in rustc_middle
.