[][src]Module rustc_ap_rustc_ast::mut_visit

A MutVisitor represents an AST modification; it accepts an AST piece and and mutates it in place. So, for instance, macro expansion is a MutVisitor that walks over an AST and modifies it.

Note: using a MutVisitor (other than the MacroExpander MutVisitor) on an AST before macro expansion is probably a bad idea. For instance, a MutVisitor renaming item names in a module will miss all of those that are created by the expansion of a macro.

Traits

ExpectOne
MutVisitor

Functions

noop_filter_map_expr
noop_flat_map_arm
noop_flat_map_assoc_item
noop_flat_map_field
noop_flat_map_field_pattern
noop_flat_map_foreign_item
noop_flat_map_generic_param
noop_flat_map_item
noop_flat_map_param
noop_flat_map_stmt
noop_flat_map_stmt_kind
noop_flat_map_struct_field
noop_flat_map_variant
noop_visit_angle_bracketed_parameter_data
noop_visit_anon_const
noop_visit_asyncness
noop_visit_attribute
noop_visit_block
noop_visit_crate
noop_visit_expr
noop_visit_fn_decl
noop_visit_fn_header
noop_visit_fn_ret_ty
noop_visit_foreign_mod
noop_visit_generic_arg
noop_visit_generic_args
noop_visit_generics
noop_visit_ident
noop_visit_interpolated

Applies the visitor to elements of interpolated nodes.

noop_visit_item_kind
noop_visit_label
noop_visit_local
noop_visit_mac
noop_visit_macro_def
noop_visit_meta_item
noop_visit_meta_list_item
noop_visit_mod
noop_visit_mt
noop_visit_param_bound
noop_visit_parenthesized_parameter_data
noop_visit_pat
noop_visit_path
noop_visit_poly_trait_ref
noop_visit_qself
noop_visit_token
noop_visit_trait_ref
noop_visit_tt
noop_visit_tts
noop_visit_ty
noop_visit_ty_constraint
noop_visit_use_tree
noop_visit_variant_data
noop_visit_vis
noop_visit_where_clause
noop_visit_where_predicate
visit_attrs
visit_bounds
visit_clobber

Use a map-style function (FnOnce(T) -> T) to overwrite a &mut T. Useful when using a flat_map_* or filter_map_* method within a visit_ method. Abort the program if the closure panics.

visit_delim_span
visit_exprs
visit_fn_sig
visit_mac_args
visit_opt
visit_thin_attrs
visit_vec