Struct rustc_save_analysis::dump_visitor::DumpVisitor [−][src]
pub struct DumpVisitor<'tcx> {
pub save_ctxt: SaveContext<'tcx>,
tcx: TyCtxt<'tcx>,
dumper: Dumper,
span: SpanUtils<'tcx>,
}
Fields
save_ctxt: SaveContext<'tcx>
tcx: TyCtxt<'tcx>
dumper: Dumper
span: SpanUtils<'tcx>
Implementations
fn nest_typeck_results<F>(&mut self, item_def_id: LocalDefId, f: F) where
F: FnOnce(&mut Self),
fn process_method(
&mut self,
sig: &'tcx FnSig<'tcx>,
body: Option<BodyId>,
def_id: LocalDefId,
ident: Ident,
generics: &'tcx Generics<'tcx>,
vis: &Visibility<'tcx>,
span: Span
)
fn process_fn(
&mut self,
item: &'tcx Item<'tcx>,
decl: &'tcx FnDecl<'tcx>,
_header: &'tcx FnHeader,
ty_params: &'tcx Generics<'tcx>,
body: BodyId
)
fn process_static_or_const_item(
&mut self,
item: &'tcx Item<'tcx>,
typ: &'tcx Ty<'tcx>,
expr: &'tcx Expr<'tcx>
)
fn process_assoc_const(
&mut self,
def_id: LocalDefId,
ident: Ident,
typ: &'tcx Ty<'tcx>,
expr: Option<&'tcx Expr<'tcx>>,
parent_id: DefId,
vis: &Visibility<'tcx>,
attrs: &'tcx [Attribute]
)
fn process_struct(
&mut self,
item: &'tcx Item<'tcx>,
def: &'tcx VariantData<'tcx>,
ty_params: &'tcx Generics<'tcx>
)
fn process_enum(
&mut self,
item: &'tcx Item<'tcx>,
enum_definition: &'tcx EnumDef<'tcx>,
ty_params: &'tcx Generics<'tcx>
)
fn process_trait(
&mut self,
item: &'tcx Item<'tcx>,
generics: &'tcx Generics<'tcx>,
trait_refs: GenericBounds<'tcx>,
methods: &'tcx [TraitItemRef]
)
fn process_struct_lit(
&mut self,
ex: &'tcx Expr<'tcx>,
path: &'tcx QPath<'tcx>,
fields: &'tcx [ExprField<'tcx>],
variant: &'tcx VariantDef,
rest: Option<&'tcx Expr<'tcx>>
)
fn process_method_call(
&mut self,
ex: &'tcx Expr<'tcx>,
seg: &'tcx PathSegment<'tcx>,
args: &'tcx [Expr<'tcx>]
)
Extracts macro use and definition information from the AST node defined by the given NodeId, using the expansion information from the node’s span.
If the span is not macro-generated, do nothing, else use callee and callsite spans to record macro definition and use data, using the mac_uses and mac_defs sets to prevent multiples.
Trait Implementations
The default versions of the visit_nested_XXX
routines invoke
this method to get a map to use. By selecting an enum variant,
you control which kinds of nested HIR are visited; see
NestedVisitorMap
for details. By “nested HIR”, we are
referring to bits of HIR that are not directly embedded within
one another but rather indirectly, through a table in the
crate. This is done to control dependencies during incremental
compilation: the non-inline bits of HIR can be tracked and
hashed separately. Read more
Visits the top-level item and (optionally) nested items / impl items. See
visit_nested_item
for details. Read more
Invoked when a nested item is encountered. By default does
nothing unless you override nested_visit_map
to return other than
None
, in which case it will walk the item. You probably
don’t want to override this method – instead, override
nested_visit_map
or use the “shallow” or “deep” visit
patterns described on itemlikevisit::ItemLikeVisitor
. The only
reason to override this method is if you want a nested pattern
but cannot supply a Map
; see nested_visit_map
for advice. Read more
Like visit_nested_item()
, but for trait items. See
visit_nested_item()
for advice on when to override this
method. Read more
Like visit_nested_item()
, but for impl items. See
visit_nested_item()
for advice on when to override this
method. Read more
Like visit_nested_item()
, but for foreign items. See
visit_nested_item()
for advice on when to override this
method. Read more
Invoked to visit the body of a function, method or closure. Like
visit_nested_item, does nothing by default unless you override
nested_visit_map
to return other than None
, in which case it will walk
the body. Read more
When invoking visit_all_item_likes()
, you need to supply an
item-like visitor. This method converts an “intra-visit”
visitor into an item-like visitor that walks the entire tree.
If you use this, you probably don’t want to process the
contents of nested item-like things, since the outer loop will
visit them as well. Read more
fn visit_variant_data(
&mut self,
s: &'v VariantData<'v>,
Symbol,
&'v Generics<'v>,
_parent_id: HirId,
Span
)
fn visit_enum_def(
&mut self,
enum_definition: &'v EnumDef<'v>,
generics: &'v Generics<'v>,
item_id: HirId,
Span
)
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for DumpVisitor<'tcx>
impl<'tcx> !Send for DumpVisitor<'tcx>
impl<'tcx> !Sync for DumpVisitor<'tcx>
impl<'tcx> Unpin for DumpVisitor<'tcx>
impl<'tcx> !UnwindSafe for DumpVisitor<'tcx>
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 552 bytes