Struct PartialMonomorphizer

Source
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>

Source

pub fn new(ctx: &'a mut TransformCtx, instantiate_types: bool) -> Self

Source

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.

Source

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).

Source

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.

Source

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<'_>

Source§

fn visit<'a, T: AstVisitable>( &'a mut self, x: &mut T, ) -> ControlFlow<Self::Break>

Visit a visitable type. This calls the appropriate method of this trait on x (visit_$ty if it exists, visit_inner if not).
Source§

fn exit_type_decl_ref(&mut self, x: &mut TypeDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn exit_fn_ptr(&mut self, x: &mut FnPtr)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn exit_fun_decl_ref(&mut self, x: &mut FunDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn exit_global_decl_ref(&mut self, x: &mut GlobalDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_decl_ref(&mut self, x: &mut TraitDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_impl_ref(&mut self, x: &mut TraitImplRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_by_val<T: AstVisitable>( self, x: &mut T, ) -> ControlFlow<Self::Break, Self>

Convenience alias for method chaining.
Source§

fn visit_by_val_infallible<T: AstVisitable>(self, x: &mut T) -> Self
where Self: Visitor<Break = Infallible> + Sized,

Convenience when the visitor does not return early.
Source§

fn visit_inner<T>(&mut self, x: &mut T) -> ControlFlow<Self::Break>
where T: AstVisitable + for<'s> DriveMut<'s, AstVisitableWrapper<Self>>,

Visit the contents of 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>

Overrideable method called when visiting a $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 more
Source§

fn enter_de_bruijn_id(&mut self, x: &mut DeBruijnId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_de_bruijn_id(&mut self, x: &mut DeBruijnId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_ty(&mut self, x: &mut Ty) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_ty(&mut self, x: &mut Ty)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_ty(&mut self, x: &mut Ty)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_ty_kind(&mut self, x: &mut TyKind) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_ty_kind(&mut self, x: &mut TyKind)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_ty_kind(&mut self, x: &mut TyKind)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_region(&mut self, x: &mut Region) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_region(&mut self, x: &mut Region)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_region(&mut self, x: &mut Region)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_const_generic( &mut self, x: &mut ConstGeneric, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_const_generic(&mut self, x: &mut ConstGeneric)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_const_generic(&mut self, x: &mut ConstGeneric)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_ref(&mut self, x: &mut TraitRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_ref(&mut self, x: &mut TraitRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_ref(&mut self, x: &mut TraitRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_ref_kind( &mut self, x: &mut TraitRefKind, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_ref_kind(&mut self, x: &mut TraitRefKind)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_ref_kind(&mut self, x: &mut TraitRefKind)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_type_decl_ref( &mut self, x: &mut TypeDeclRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_type_decl_ref(&mut self, x: &mut TypeDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_fun_decl_ref(&mut self, x: &mut FunDeclRef) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_fun_decl_ref(&mut self, x: &mut FunDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_maybe_builtin_fun_decl_ref( &mut self, x: &mut MaybeBuiltinFunDeclRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_maybe_builtin_fun_decl_ref(&mut self, x: &mut MaybeBuiltinFunDeclRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_method_ref( &mut self, x: &mut TraitMethodRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_method_ref(&mut self, x: &mut TraitMethodRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_method_ref(&mut self, x: &mut TraitMethodRef)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_global_decl_ref( &mut self, x: &mut GlobalDeclRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_global_decl_ref(&mut self, x: &mut GlobalDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_decl_ref( &mut self, x: &mut TraitDeclRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_decl_ref(&mut self, x: &mut TraitDeclRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_impl_ref( &mut self, x: &mut TraitImplRef, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_impl_ref(&mut self, x: &mut TraitImplRef)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_generic_args( &mut self, x: &mut GenericArgs, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_generic_args(&mut self, x: &mut GenericArgs)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_generic_args(&mut self, x: &mut GenericArgs)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_generic_params( &mut self, x: &mut GenericParams, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_generic_params(&mut self, x: &mut GenericParams)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_generic_params(&mut self, x: &mut GenericParams)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_param(&mut self, x: &mut TraitParam) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_param(&mut self, x: &mut TraitParam)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_param(&mut self, x: &mut TraitParam)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_clause_id( &mut self, x: &mut TraitClauseId, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_clause_id(&mut self, x: &mut TraitClauseId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_clause_id(&mut self, x: &mut TraitClauseId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_type_constraint( &mut self, x: &mut TraitTypeConstraint, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_type_constraint(&mut self, x: &mut TraitTypeConstraint)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_place(&mut self, x: &mut Place) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_place(&mut self, x: &mut Place)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_place(&mut self, x: &mut Place)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_rvalue(&mut self, x: &mut Rvalue) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_rvalue(&mut self, x: &mut Rvalue)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_rvalue(&mut self, x: &mut Rvalue)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_de_bruijn_var<T: AstVisitable + Idx>( &mut self, x: &mut DeBruijnVar<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_de_bruijn_var<T: AstVisitable + Idx>(&mut self, x: &mut DeBruijnVar<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_region_binder<T: AstVisitable>( &mut self, x: &mut RegionBinder<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_region_binder<T: AstVisitable>(&mut self, x: &mut RegionBinder<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_binder<T: AstVisitable>( &mut self, x: &mut Binder<T>, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_binder<T: AstVisitable>(&mut self, x: &mut Binder<T>)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_llbc_block(&mut self, x: &mut Block) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_llbc_block(&mut self, x: &mut Block)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_llbc_block(&mut self, x: &mut Block)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_llbc_statement( &mut self, x: &mut Statement, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_llbc_statement(&mut self, x: &mut Statement)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_llbc_statement(&mut self, x: &mut Statement)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_ullbc_statement( &mut self, x: &mut Statement, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_ullbc_statement(&mut self, x: &mut Statement)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_ullbc_statement(&mut self, x: &mut Statement)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_ullbc_terminator( &mut self, x: &mut Terminator, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_ullbc_terminator(&mut self, x: &mut Terminator)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_ullbc_terminator(&mut self, x: &mut Terminator)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_aggregate_kind( &mut self, x: &mut AggregateKind, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_aggregate_kind(&mut self, x: &mut AggregateKind)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_aggregate_kind(&mut self, x: &mut AggregateKind)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_fn_ptr(&mut self, x: &mut FnPtr) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_fn_ptr(&mut self, x: &mut FnPtr)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn visit_item_source(&mut self, x: &mut ItemSource) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_item_source(&mut self, x: &mut ItemSource)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_item_source(&mut self, x: &mut ItemSource)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_item_meta(&mut self, x: &mut ItemMeta) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_item_meta(&mut self, x: &mut ItemMeta)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_item_meta(&mut self, x: &mut ItemMeta)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_span(&mut self, x: &mut Span) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_span(&mut self, x: &mut Span)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_span(&mut self, x: &mut Span)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_constant_expr( &mut self, x: &mut ConstantExpr, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_constant_expr(&mut self, x: &mut ConstantExpr)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_constant_expr(&mut self, x: &mut ConstantExpr)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_fun_decl_id(&mut self, x: &mut FunDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_fun_decl_id(&mut self, x: &mut FunDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_fun_decl_id(&mut self, x: &mut FunDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_global_decl_id( &mut self, x: &mut GlobalDeclId, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_global_decl_id(&mut self, x: &mut GlobalDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_global_decl_id(&mut self, x: &mut GlobalDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_type_decl_id(&mut self, x: &mut TypeDeclId) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_type_decl_id(&mut self, x: &mut TypeDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_type_decl_id(&mut self, x: &mut TypeDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_decl_id( &mut self, x: &mut TraitDeclId, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_decl_id(&mut self, x: &mut TraitDeclId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_decl_id(&mut self, x: &mut TraitDeclId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_impl_id( &mut self, x: &mut TraitImplId, ) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_impl_id(&mut self, x: &mut TraitImplId)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_impl_id(&mut self, x: &mut TraitImplId)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_fun_decl(&mut self, x: &mut FunDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_fun_decl(&mut self, x: &mut FunDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_fun_decl(&mut self, x: &mut FunDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_global_decl(&mut self, x: &mut GlobalDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_global_decl(&mut self, x: &mut GlobalDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_global_decl(&mut self, x: &mut GlobalDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_type_decl(&mut self, x: &mut TypeDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_type_decl(&mut self, x: &mut TypeDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_type_decl(&mut self, x: &mut TypeDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_decl(&mut self, x: &mut TraitDecl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_decl(&mut self, x: &mut TraitDecl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_decl(&mut self, x: &mut TraitDecl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

fn visit_trait_impl(&mut self, x: &mut TraitImpl) -> ControlFlow<Self::Break>

Overrideable method called when visiting a $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 more
Source§

fn enter_trait_impl(&mut self, x: &mut TraitImpl)

Called when starting to visit a $ty (unless visit_$ty is overriden).
Source§

fn exit_trait_impl(&mut self, x: &mut TraitImpl)

Called when finished visiting a $ty (unless visit_$ty is overriden).
Source§

impl<'a> Visitor for PartialMonomorphizer<'a>

Source§

type Break = Infallible

The type used for early-return, if the visitor supports it. Use an empty type like std::convert::Infallible if the visitor does not short-circuit.
Source§

impl VisitorWithSpan for PartialMonomorphizer<'_>

Source§

fn current_span(&mut self) -> &mut Span

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more