[][src]Module syntax::visit

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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.

Note: it is an important invariant that the default visitor walks the body of a function in "execution order" (more concretely, reverse post-order with respect to the CFG implied by the AST), meaning that if AST node A may execute before AST node B, then A is visited first. The borrow checker in particular relies on this property.

Note: walking an AST before macro expansion is probably a bad idea. For instance, a walker looking for item names in a module will miss all of those that are created by the expansion of a macro.

Enums

FnKindInternal

Traits

VisitorInternal

Each method of the Visitor trait is a hook to be potentially overridden. Each method's default implementation recursively visits the substructure of the input via the corresponding walk method; e.g., the visit_mod method by default calls visit::walk_mod.

Functions

walk_anon_constInternal
walk_armInternal
walk_assoc_type_bindingInternal
walk_attributeInternal
walk_blockInternal
walk_crateInternal
walk_enum_defInternal
walk_exprInternal
walk_fnInternal
walk_fn_declInternal
walk_fn_ret_tyInternal
walk_foreign_itemInternal
walk_generic_argsInternal
walk_generic_paramInternal
walk_genericsInternal
walk_global_asmInternal
walk_identInternal
walk_impl_itemInternal
walk_itemInternal
walk_labelInternal
walk_lifetimeInternal
walk_localInternal
walk_macInternal
walk_modInternal
walk_param_boundInternal
walk_patInternal
walk_pathInternal
walk_path_segmentInternal
walk_poly_trait_refInternal
walk_stmtInternal
walk_struct_defInternal
walk_struct_fieldInternal
walk_trait_itemInternal
walk_trait_refInternal
walk_ttInternal
walk_ttsInternal
walk_tyInternal
walk_use_treeInternal
walk_variantInternal
walk_visInternal
walk_where_predicateInternal