struct PartialMonomorphizer<'a> {
ctx: &'a mut TransformCtx,
span: Span,
instantiate_types: bool,
infected_types: HashSet<TypeDeclId>,
generic_params: HashMap<ItemId, GenericParams>,
partial_mono_shapes: IndexMap<(ItemId, Binder<GenericArgs>), ItemId>,
reverse_shape_map: HashMap<ItemId, (ItemId, Binder<GenericArgs>)>,
to_process: VecDeque<ItemId>,
}
Fields§
§ctx: &'a mut TransformCtx
§span: Span
Tracks the closest span to emit useful errors.
instantiate_types: bool
Whether we partially-monomorphize type declarations.
infected_types: HashSet<TypeDeclId>
Types that contain mutable references.
generic_params: HashMap<ItemId, GenericParams>
Map of generic params for each item. We can’t use ctx.translated
because while iterating
over items the current item isn’t available anymore, which would break recursive types.
This also makes it possible to record the generics of our to-be-added items without adding
them.
partial_mono_shapes: IndexMap<(ItemId, Binder<GenericArgs>), ItemId>
Map of partial monomorphizations. The source item applied with the generic params gives the target item. The resulting partially-monomorphized item will have the binder params as generic params.
reverse_shape_map: HashMap<ItemId, (ItemId, Binder<GenericArgs>)>
Reverse of partial_mono_shapes
.
to_process: VecDeque<ItemId>
Items that need to be processed.
Implementations§
Source§impl<'a> PartialMonomorphizer<'a>
impl<'a> PartialMonomorphizer<'a>
pub fn new(ctx: &'a mut TransformCtx, instantiate_types: bool) -> Self
Sourcefn is_infected(&self, ty: &Ty) -> bool
fn is_infected(&self, ty: &Ty) -> bool
Whether this type is or contains a &mut
. This assumes that we’ve already visited this
type and partially monomorphized any ADT references.
Sourcefn process_generics(
&mut self,
id: ItemId,
generics: &GenericArgs,
) -> Option<DeclRef<ItemId>>
fn process_generics( &mut self, id: ItemId, generics: &GenericArgs, ) -> Option<DeclRef<ItemId>>
Given that generics
apply to item id
, if any of the generics is infected we generate a
reference to a new item obtained by partially instantiating item id
. (That new item isn’t
added immediately but is added to the to_process
queue to be created later).
Sourcepub fn process_item(&mut self, item: &mut ItemRefMut<'_>)
pub fn process_item(&mut self, item: &mut ItemRefMut<'_>)
Traverse the item, replacing any type instantiations we don’t want with references to
soon-to-be-created partially-monomorphized types. This does not access the items in
self.translated
, which may be missing since we took item
out for processing.
Sourcepub fn create_pending_instantiation(&mut self, new_id: ItemId) -> ItemByVal
pub fn create_pending_instantiation(&mut self, new_id: ItemId) -> ItemByVal
Creates the item corresponding to this id by instantiating the item it is based on.
This accesses the items in self.translated
, which must therefore all be there.
That’s why items are created outside of process_item
.
Trait Implementations§
Source§impl VisitAstMut for PartialMonomorphizer<'_>
impl VisitAstMut for PartialMonomorphizer<'_>
Source§fn visit<'a, T: AstVisitable>(
&'a mut self,
x: &mut T,
) -> ControlFlow<Self::Break>
fn visit<'a, T: AstVisitable>( &'a mut self, x: &mut T, ) -> ControlFlow<Self::Break>
x
(visit_$ty
if it exists, visit_inner
if not).Source§fn exit_type_decl_ref(&mut self, x: &mut TypeDeclRef)
fn exit_type_decl_ref(&mut self, x: &mut TypeDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_fn_ptr(&mut self, x: &mut FnPtr)
fn exit_fn_ptr(&mut self, x: &mut FnPtr)
$ty
(unless visit_$ty
is overriden).Source§fn exit_fun_decl_ref(&mut self, x: &mut FunDeclRef)
fn exit_fun_decl_ref(&mut self, x: &mut FunDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_global_decl_ref(&mut self, x: &mut GlobalDeclRef)
fn exit_global_decl_ref(&mut self, x: &mut GlobalDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_decl_ref(&mut self, x: &mut TraitDeclRef)
fn exit_trait_decl_ref(&mut self, x: &mut TraitDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_impl_ref(&mut self, x: &mut TraitImplRef)
fn exit_trait_impl_ref(&mut self, x: &mut TraitImplRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_by_val<T: AstVisitable>(
self,
x: &mut T,
) -> ControlFlow<Self::Break, Self>
fn visit_by_val<T: AstVisitable>( self, x: &mut T, ) -> ControlFlow<Self::Break, Self>
Source§fn visit_by_val_infallible<T: AstVisitable>(self, x: &mut T) -> Self
fn visit_by_val_infallible<T: AstVisitable>(self, x: &mut T) -> Self
Source§fn visit_inner<T>(&mut self, x: &mut T) -> ControlFlow<Self::Break>where
T: AstVisitable + for<'s> DriveMut<'s, AstVisitableWrapper<Self>>,
fn visit_inner<T>(&mut self, x: &mut T) -> ControlFlow<Self::Break>where
T: AstVisitable + for<'s> DriveMut<'s, AstVisitableWrapper<Self>>,
x
. This calls self.visit()
on each field of T
. This
is available for any type whose contents are all #trait_name
.Source§fn visit_de_bruijn_id(&mut self, x: &mut DeBruijnId) -> ControlFlow<Self::Break>
fn visit_de_bruijn_id(&mut self, x: &mut DeBruijnId) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_de_bruijn_id(&mut self, x: &mut DeBruijnId)
fn enter_de_bruijn_id(&mut self, x: &mut DeBruijnId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_de_bruijn_id(&mut self, x: &mut DeBruijnId)
fn exit_de_bruijn_id(&mut self, x: &mut DeBruijnId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_ty(&mut self, x: &mut Ty) -> ControlFlow<Self::Break>
fn visit_ty(&mut self, x: &mut Ty) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ty(&mut self, x: &mut Ty)
fn enter_ty(&mut self, x: &mut Ty)
$ty
(unless visit_$ty
is overriden).Source§fn exit_ty(&mut self, x: &mut Ty)
fn exit_ty(&mut self, x: &mut Ty)
$ty
(unless visit_$ty
is overriden).Source§fn visit_ty_kind(&mut self, x: &mut TyKind) -> ControlFlow<Self::Break>
fn visit_ty_kind(&mut self, x: &mut TyKind) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ty_kind(&mut self, x: &mut TyKind)
fn enter_ty_kind(&mut self, x: &mut TyKind)
$ty
(unless visit_$ty
is overriden).Source§fn exit_ty_kind(&mut self, x: &mut TyKind)
fn exit_ty_kind(&mut self, x: &mut TyKind)
$ty
(unless visit_$ty
is overriden).Source§fn visit_region(&mut self, x: &mut Region) -> ControlFlow<Self::Break>
fn visit_region(&mut self, x: &mut Region) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_region(&mut self, x: &mut Region)
fn enter_region(&mut self, x: &mut Region)
$ty
(unless visit_$ty
is overriden).Source§fn exit_region(&mut self, x: &mut Region)
fn exit_region(&mut self, x: &mut Region)
$ty
(unless visit_$ty
is overriden).Source§fn visit_const_generic(
&mut self,
x: &mut ConstGeneric,
) -> ControlFlow<Self::Break>
fn visit_const_generic( &mut self, x: &mut ConstGeneric, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_const_generic(&mut self, x: &mut ConstGeneric)
fn enter_const_generic(&mut self, x: &mut ConstGeneric)
$ty
(unless visit_$ty
is overriden).Source§fn exit_const_generic(&mut self, x: &mut ConstGeneric)
fn exit_const_generic(&mut self, x: &mut ConstGeneric)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_ref(&mut self, x: &mut TraitRef) -> ControlFlow<Self::Break>
fn visit_trait_ref(&mut self, x: &mut TraitRef) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_ref(&mut self, x: &mut TraitRef)
fn enter_trait_ref(&mut self, x: &mut TraitRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_ref(&mut self, x: &mut TraitRef)
fn exit_trait_ref(&mut self, x: &mut TraitRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_ref_kind(
&mut self,
x: &mut TraitRefKind,
) -> ControlFlow<Self::Break>
fn visit_trait_ref_kind( &mut self, x: &mut TraitRefKind, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_ref_kind(&mut self, x: &mut TraitRefKind)
fn enter_trait_ref_kind(&mut self, x: &mut TraitRefKind)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_ref_kind(&mut self, x: &mut TraitRefKind)
fn exit_trait_ref_kind(&mut self, x: &mut TraitRefKind)
$ty
(unless visit_$ty
is overriden).Source§fn visit_type_decl_ref(
&mut self,
x: &mut TypeDeclRef,
) -> ControlFlow<Self::Break>
fn visit_type_decl_ref( &mut self, x: &mut TypeDeclRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_type_decl_ref(&mut self, x: &mut TypeDeclRef)
fn enter_type_decl_ref(&mut self, x: &mut TypeDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_fun_decl_ref(&mut self, x: &mut FunDeclRef) -> ControlFlow<Self::Break>
fn visit_fun_decl_ref(&mut self, x: &mut FunDeclRef) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fun_decl_ref(&mut self, x: &mut FunDeclRef)
fn enter_fun_decl_ref(&mut self, x: &mut FunDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_maybe_builtin_fun_decl_ref(
&mut self,
x: &mut MaybeBuiltinFunDeclRef,
) -> ControlFlow<Self::Break>
fn visit_maybe_builtin_fun_decl_ref( &mut self, x: &mut MaybeBuiltinFunDeclRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)
fn enter_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)
fn exit_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_method_ref(
&mut self,
x: &mut TraitMethodRef,
) -> ControlFlow<Self::Break>
fn visit_trait_method_ref( &mut self, x: &mut TraitMethodRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_method_ref(&mut self, x: &mut TraitMethodRef)
fn enter_trait_method_ref(&mut self, x: &mut TraitMethodRef)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_method_ref(&mut self, x: &mut TraitMethodRef)
fn exit_trait_method_ref(&mut self, x: &mut TraitMethodRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_global_decl_ref(
&mut self,
x: &mut GlobalDeclRef,
) -> ControlFlow<Self::Break>
fn visit_global_decl_ref( &mut self, x: &mut GlobalDeclRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_global_decl_ref(&mut self, x: &mut GlobalDeclRef)
fn enter_global_decl_ref(&mut self, x: &mut GlobalDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_decl_ref(
&mut self,
x: &mut TraitDeclRef,
) -> ControlFlow<Self::Break>
fn visit_trait_decl_ref( &mut self, x: &mut TraitDeclRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_decl_ref(&mut self, x: &mut TraitDeclRef)
fn enter_trait_decl_ref(&mut self, x: &mut TraitDeclRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_impl_ref(
&mut self,
x: &mut TraitImplRef,
) -> ControlFlow<Self::Break>
fn visit_trait_impl_ref( &mut self, x: &mut TraitImplRef, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_impl_ref(&mut self, x: &mut TraitImplRef)
fn enter_trait_impl_ref(&mut self, x: &mut TraitImplRef)
$ty
(unless visit_$ty
is overriden).Source§fn visit_generic_args(
&mut self,
x: &mut GenericArgs,
) -> ControlFlow<Self::Break>
fn visit_generic_args( &mut self, x: &mut GenericArgs, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_generic_args(&mut self, x: &mut GenericArgs)
fn enter_generic_args(&mut self, x: &mut GenericArgs)
$ty
(unless visit_$ty
is overriden).Source§fn exit_generic_args(&mut self, x: &mut GenericArgs)
fn exit_generic_args(&mut self, x: &mut GenericArgs)
$ty
(unless visit_$ty
is overriden).Source§fn visit_generic_params(
&mut self,
x: &mut GenericParams,
) -> ControlFlow<Self::Break>
fn visit_generic_params( &mut self, x: &mut GenericParams, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_generic_params(&mut self, x: &mut GenericParams)
fn enter_generic_params(&mut self, x: &mut GenericParams)
$ty
(unless visit_$ty
is overriden).Source§fn exit_generic_params(&mut self, x: &mut GenericParams)
fn exit_generic_params(&mut self, x: &mut GenericParams)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_param(&mut self, x: &mut TraitParam) -> ControlFlow<Self::Break>
fn visit_trait_param(&mut self, x: &mut TraitParam) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_param(&mut self, x: &mut TraitParam)
fn enter_trait_param(&mut self, x: &mut TraitParam)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_param(&mut self, x: &mut TraitParam)
fn exit_trait_param(&mut self, x: &mut TraitParam)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_clause_id(
&mut self,
x: &mut TraitClauseId,
) -> ControlFlow<Self::Break>
fn visit_trait_clause_id( &mut self, x: &mut TraitClauseId, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_clause_id(&mut self, x: &mut TraitClauseId)
fn enter_trait_clause_id(&mut self, x: &mut TraitClauseId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_clause_id(&mut self, x: &mut TraitClauseId)
fn exit_trait_clause_id(&mut self, x: &mut TraitClauseId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_type_constraint(
&mut self,
x: &mut TraitTypeConstraint,
) -> ControlFlow<Self::Break>
fn visit_trait_type_constraint( &mut self, x: &mut TraitTypeConstraint, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)
fn enter_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)
fn exit_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)
$ty
(unless visit_$ty
is overriden).Source§fn visit_place(&mut self, x: &mut Place) -> ControlFlow<Self::Break>
fn visit_place(&mut self, x: &mut Place) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_place(&mut self, x: &mut Place)
fn enter_place(&mut self, x: &mut Place)
$ty
(unless visit_$ty
is overriden).Source§fn exit_place(&mut self, x: &mut Place)
fn exit_place(&mut self, x: &mut Place)
$ty
(unless visit_$ty
is overriden).Source§fn visit_rvalue(&mut self, x: &mut Rvalue) -> ControlFlow<Self::Break>
fn visit_rvalue(&mut self, x: &mut Rvalue) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_rvalue(&mut self, x: &mut Rvalue)
fn enter_rvalue(&mut self, x: &mut Rvalue)
$ty
(unless visit_$ty
is overriden).Source§fn exit_rvalue(&mut self, x: &mut Rvalue)
fn exit_rvalue(&mut self, x: &mut Rvalue)
$ty
(unless visit_$ty
is overriden).Source§fn visit_de_bruijn_var<T: AstVisitable + Idx>(
&mut self,
x: &mut DeBruijnVar<T>,
) -> ControlFlow<Self::Break>
fn visit_de_bruijn_var<T: AstVisitable + Idx>( &mut self, x: &mut DeBruijnVar<T>, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)
fn enter_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)
$ty
(unless visit_$ty
is overriden).Source§fn exit_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)
fn exit_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)
$ty
(unless visit_$ty
is overriden).Source§fn visit_region_binder<T: AstVisitable>(
&mut self,
x: &mut RegionBinder<T>,
) -> ControlFlow<Self::Break>
fn visit_region_binder<T: AstVisitable>( &mut self, x: &mut RegionBinder<T>, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)
fn enter_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)
$ty
(unless visit_$ty
is overriden).Source§fn exit_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)
fn exit_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)
$ty
(unless visit_$ty
is overriden).Source§fn visit_binder<T: AstVisitable>(
&mut self,
x: &mut Binder<T>,
) -> ControlFlow<Self::Break>
fn visit_binder<T: AstVisitable>( &mut self, x: &mut Binder<T>, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)
fn enter_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)
$ty
(unless visit_$ty
is overriden).Source§fn exit_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)
fn exit_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)
$ty
(unless visit_$ty
is overriden).Source§fn visit_llbc_block(&mut self, x: &mut Block) -> ControlFlow<Self::Break>
fn visit_llbc_block(&mut self, x: &mut Block) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_llbc_block(&mut self, x: &mut Block)
fn enter_llbc_block(&mut self, x: &mut Block)
$ty
(unless visit_$ty
is overriden).Source§fn exit_llbc_block(&mut self, x: &mut Block)
fn exit_llbc_block(&mut self, x: &mut Block)
$ty
(unless visit_$ty
is overriden).Source§fn visit_llbc_statement(
&mut self,
x: &mut Statement,
) -> ControlFlow<Self::Break>
fn visit_llbc_statement( &mut self, x: &mut Statement, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_llbc_statement(&mut self, x: &mut Statement)
fn enter_llbc_statement(&mut self, x: &mut Statement)
$ty
(unless visit_$ty
is overriden).Source§fn exit_llbc_statement(&mut self, x: &mut Statement)
fn exit_llbc_statement(&mut self, x: &mut Statement)
$ty
(unless visit_$ty
is overriden).Source§fn visit_ullbc_statement(
&mut self,
x: &mut Statement,
) -> ControlFlow<Self::Break>
fn visit_ullbc_statement( &mut self, x: &mut Statement, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ullbc_statement(&mut self, x: &mut Statement)
fn enter_ullbc_statement(&mut self, x: &mut Statement)
$ty
(unless visit_$ty
is overriden).Source§fn exit_ullbc_statement(&mut self, x: &mut Statement)
fn exit_ullbc_statement(&mut self, x: &mut Statement)
$ty
(unless visit_$ty
is overriden).Source§fn visit_ullbc_terminator(
&mut self,
x: &mut Terminator,
) -> ControlFlow<Self::Break>
fn visit_ullbc_terminator( &mut self, x: &mut Terminator, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_ullbc_terminator(&mut self, x: &mut Terminator)
fn enter_ullbc_terminator(&mut self, x: &mut Terminator)
$ty
(unless visit_$ty
is overriden).Source§fn exit_ullbc_terminator(&mut self, x: &mut Terminator)
fn exit_ullbc_terminator(&mut self, x: &mut Terminator)
$ty
(unless visit_$ty
is overriden).Source§fn visit_aggregate_kind(
&mut self,
x: &mut AggregateKind,
) -> ControlFlow<Self::Break>
fn visit_aggregate_kind( &mut self, x: &mut AggregateKind, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_aggregate_kind(&mut self, x: &mut AggregateKind)
fn enter_aggregate_kind(&mut self, x: &mut AggregateKind)
$ty
(unless visit_$ty
is overriden).Source§fn exit_aggregate_kind(&mut self, x: &mut AggregateKind)
fn exit_aggregate_kind(&mut self, x: &mut AggregateKind)
$ty
(unless visit_$ty
is overriden).Source§fn visit_fn_ptr(&mut self, x: &mut FnPtr) -> ControlFlow<Self::Break>
fn visit_fn_ptr(&mut self, x: &mut FnPtr) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fn_ptr(&mut self, x: &mut FnPtr)
fn enter_fn_ptr(&mut self, x: &mut FnPtr)
$ty
(unless visit_$ty
is overriden).Source§fn visit_item_source(&mut self, x: &mut ItemSource) -> ControlFlow<Self::Break>
fn visit_item_source(&mut self, x: &mut ItemSource) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_item_source(&mut self, x: &mut ItemSource)
fn enter_item_source(&mut self, x: &mut ItemSource)
$ty
(unless visit_$ty
is overriden).Source§fn exit_item_source(&mut self, x: &mut ItemSource)
fn exit_item_source(&mut self, x: &mut ItemSource)
$ty
(unless visit_$ty
is overriden).Source§fn visit_item_meta(&mut self, x: &mut ItemMeta) -> ControlFlow<Self::Break>
fn visit_item_meta(&mut self, x: &mut ItemMeta) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_item_meta(&mut self, x: &mut ItemMeta)
fn enter_item_meta(&mut self, x: &mut ItemMeta)
$ty
(unless visit_$ty
is overriden).Source§fn exit_item_meta(&mut self, x: &mut ItemMeta)
fn exit_item_meta(&mut self, x: &mut ItemMeta)
$ty
(unless visit_$ty
is overriden).Source§fn visit_span(&mut self, x: &mut Span) -> ControlFlow<Self::Break>
fn visit_span(&mut self, x: &mut Span) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_span(&mut self, x: &mut Span)
fn enter_span(&mut self, x: &mut Span)
$ty
(unless visit_$ty
is overriden).Source§fn exit_span(&mut self, x: &mut Span)
fn exit_span(&mut self, x: &mut Span)
$ty
(unless visit_$ty
is overriden).Source§fn visit_constant_expr(
&mut self,
x: &mut ConstantExpr,
) -> ControlFlow<Self::Break>
fn visit_constant_expr( &mut self, x: &mut ConstantExpr, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_constant_expr(&mut self, x: &mut ConstantExpr)
fn enter_constant_expr(&mut self, x: &mut ConstantExpr)
$ty
(unless visit_$ty
is overriden).Source§fn exit_constant_expr(&mut self, x: &mut ConstantExpr)
fn exit_constant_expr(&mut self, x: &mut ConstantExpr)
$ty
(unless visit_$ty
is overriden).Source§fn visit_fun_decl_id(&mut self, x: &mut FunDeclId) -> ControlFlow<Self::Break>
fn visit_fun_decl_id(&mut self, x: &mut FunDeclId) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fun_decl_id(&mut self, x: &mut FunDeclId)
fn enter_fun_decl_id(&mut self, x: &mut FunDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_fun_decl_id(&mut self, x: &mut FunDeclId)
fn exit_fun_decl_id(&mut self, x: &mut FunDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_global_decl_id(
&mut self,
x: &mut GlobalDeclId,
) -> ControlFlow<Self::Break>
fn visit_global_decl_id( &mut self, x: &mut GlobalDeclId, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_global_decl_id(&mut self, x: &mut GlobalDeclId)
fn enter_global_decl_id(&mut self, x: &mut GlobalDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_global_decl_id(&mut self, x: &mut GlobalDeclId)
fn exit_global_decl_id(&mut self, x: &mut GlobalDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_type_decl_id(&mut self, x: &mut TypeDeclId) -> ControlFlow<Self::Break>
fn visit_type_decl_id(&mut self, x: &mut TypeDeclId) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_type_decl_id(&mut self, x: &mut TypeDeclId)
fn enter_type_decl_id(&mut self, x: &mut TypeDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_type_decl_id(&mut self, x: &mut TypeDeclId)
fn exit_type_decl_id(&mut self, x: &mut TypeDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_decl_id(
&mut self,
x: &mut TraitDeclId,
) -> ControlFlow<Self::Break>
fn visit_trait_decl_id( &mut self, x: &mut TraitDeclId, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_decl_id(&mut self, x: &mut TraitDeclId)
fn enter_trait_decl_id(&mut self, x: &mut TraitDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_decl_id(&mut self, x: &mut TraitDeclId)
fn exit_trait_decl_id(&mut self, x: &mut TraitDeclId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_impl_id(
&mut self,
x: &mut TraitImplId,
) -> ControlFlow<Self::Break>
fn visit_trait_impl_id( &mut self, x: &mut TraitImplId, ) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_impl_id(&mut self, x: &mut TraitImplId)
fn enter_trait_impl_id(&mut self, x: &mut TraitImplId)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_impl_id(&mut self, x: &mut TraitImplId)
fn exit_trait_impl_id(&mut self, x: &mut TraitImplId)
$ty
(unless visit_$ty
is overriden).Source§fn visit_fun_decl(&mut self, x: &mut FunDecl) -> ControlFlow<Self::Break>
fn visit_fun_decl(&mut self, x: &mut FunDecl) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_fun_decl(&mut self, x: &mut FunDecl)
fn enter_fun_decl(&mut self, x: &mut FunDecl)
$ty
(unless visit_$ty
is overriden).Source§fn exit_fun_decl(&mut self, x: &mut FunDecl)
fn exit_fun_decl(&mut self, x: &mut FunDecl)
$ty
(unless visit_$ty
is overriden).Source§fn visit_global_decl(&mut self, x: &mut GlobalDecl) -> ControlFlow<Self::Break>
fn visit_global_decl(&mut self, x: &mut GlobalDecl) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_global_decl(&mut self, x: &mut GlobalDecl)
fn enter_global_decl(&mut self, x: &mut GlobalDecl)
$ty
(unless visit_$ty
is overriden).Source§fn exit_global_decl(&mut self, x: &mut GlobalDecl)
fn exit_global_decl(&mut self, x: &mut GlobalDecl)
$ty
(unless visit_$ty
is overriden).Source§fn visit_type_decl(&mut self, x: &mut TypeDecl) -> ControlFlow<Self::Break>
fn visit_type_decl(&mut self, x: &mut TypeDecl) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_type_decl(&mut self, x: &mut TypeDecl)
fn enter_type_decl(&mut self, x: &mut TypeDecl)
$ty
(unless visit_$ty
is overriden).Source§fn exit_type_decl(&mut self, x: &mut TypeDecl)
fn exit_type_decl(&mut self, x: &mut TypeDecl)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_decl(&mut self, x: &mut TraitDecl) -> ControlFlow<Self::Break>
fn visit_trait_decl(&mut self, x: &mut TraitDecl) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_decl(&mut self, x: &mut TraitDecl)
fn enter_trait_decl(&mut self, x: &mut TraitDecl)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_decl(&mut self, x: &mut TraitDecl)
fn exit_trait_decl(&mut self, x: &mut TraitDecl)
$ty
(unless visit_$ty
is overriden).Source§fn visit_trait_impl(&mut self, x: &mut TraitImpl) -> ControlFlow<Self::Break>
fn visit_trait_impl(&mut self, x: &mut TraitImpl) -> ControlFlow<Self::Break>
$ty
. When overriding this method,
call self.visit_inner(x)
to keep recursively visiting the type, or don’t call
it if the contents of x
should not be visited. Read moreSource§fn enter_trait_impl(&mut self, x: &mut TraitImpl)
fn enter_trait_impl(&mut self, x: &mut TraitImpl)
$ty
(unless visit_$ty
is overriden).Source§fn exit_trait_impl(&mut self, x: &mut TraitImpl)
fn exit_trait_impl(&mut self, x: &mut TraitImpl)
$ty
(unless visit_$ty
is overriden).Source§impl<'a> Visitor for PartialMonomorphizer<'a>
impl<'a> Visitor for PartialMonomorphizer<'a>
Source§type Break = Infallible
type Break = Infallible
std::convert::Infallible
if the visitor does not short-circuit.Source§impl VisitorWithSpan for PartialMonomorphizer<'_>
impl VisitorWithSpan for PartialMonomorphizer<'_>
fn current_span(&mut self) -> &mut Span
Auto Trait Implementations§
impl<'a> Freeze for PartialMonomorphizer<'a>
impl<'a> !RefUnwindSafe for PartialMonomorphizer<'a>
impl<'a> Send for PartialMonomorphizer<'a>
impl<'a> !Sync for PartialMonomorphizer<'a>
impl<'a> Unpin for PartialMonomorphizer<'a>
impl<'a> !UnwindSafe for PartialMonomorphizer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more