Module syntax::visit [] [src]

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

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

FnKind [
Experimental
]

Traits

Visitor [
Experimental
]

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_arm [
Experimental
]
walk_assoc_type_binding [
Experimental
]
walk_block [
Experimental
]
walk_crate [
Experimental
]
walk_enum_def [
Experimental
]
walk_expr [
Experimental
]
walk_fn [
Experimental
]
walk_fn_decl [
Experimental
]
walk_fn_ret_ty [
Experimental
]
walk_foreign_item [
Experimental
]
walk_generics [
Experimental
]
walk_ident [
Experimental
]
walk_impl_item [
Experimental
]
walk_item [
Experimental
]
walk_lifetime [
Experimental
]
walk_lifetime_def [
Experimental
]
walk_local [
Experimental
]
walk_mac [
Experimental
]
walk_mod [
Experimental
]
walk_opt_ident [
Experimental
]
walk_opt_name [
Experimental
]
walk_opt_sp_ident [
Experimental
]
walk_pat [
Experimental
]
walk_path [
Experimental
]
walk_path_list_item [
Experimental
]
walk_path_parameters [
Experimental
]
walk_path_segment [
Experimental
]
walk_poly_trait_ref [
Experimental
]
walk_stmt [
Experimental
]
walk_struct_def [
Experimental
]
walk_struct_field [
Experimental
]
walk_trait_item [
Experimental
]
walk_trait_ref [
Experimental
]
walk_ty [
Experimental
]
walk_ty_param_bound [
Experimental
]
walk_variant [
Experimental
]
walk_vis [
Experimental
]
walk_where_predicate [
Experimental
]