pub struct VarReassigner<'a> {
pub old_vars: &'a Arena<Variable>,
pub new_vars: Arena<Variable>,
pub vars: UnorderedHashMap<VariableId, VariableId>,
}
Expand description
Helper class to reassign variable ids according to the rebuild order.
Note that it can’t be integrated into the RebuildContext above because rebuild_remapping might
call map_var_id
on variables that are going to be removed.
Fields§
§old_vars: &'a Arena<Variable>
§new_vars: Arena<Variable>
§vars: UnorderedHashMap<VariableId, VariableId>
Implementations§
Trait Implementations§
Source§impl Rebuilder for VarReassigner<'_>
impl Rebuilder for VarReassigner<'_>
fn map_var_id(&mut self, var: VariableId) -> VariableId
fn map_block_id(&mut self, block: BlockId) -> BlockId
fn map_var_usage(&mut self, var_usage: VarUsage) -> VarUsage
fn map_location(&mut self, location: LocationId) -> LocationId
fn transform_statement(&mut self, _statement: &mut Statement)
fn transform_remapping(&mut self, _remapping: &mut VarRemapping)
fn transform_end(&mut self, _end: &mut FlatBlockEnd)
fn transform_block(&mut self, _block: &mut FlatBlock)
Auto Trait Implementations§
impl<'a> Freeze for VarReassigner<'a>
impl<'a> RefUnwindSafe for VarReassigner<'a>
impl<'a> Send for VarReassigner<'a>
impl<'a> Sync for VarReassigner<'a>
impl<'a> Unpin for VarReassigner<'a>
impl<'a> UnwindSafe for VarReassigner<'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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 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>
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 moreSource§impl<T> RebuilderEx for Twhere
T: Rebuilder,
impl<T> RebuilderEx for Twhere
T: Rebuilder,
Source§fn rebuild_statement(&mut self, statement: &Statement) -> Statement
fn rebuild_statement(&mut self, statement: &Statement) -> Statement
Rebuilds the statement with renamed var and block ids.
Source§fn rebuild_remapping(&mut self, remapping: &VarRemapping) -> VarRemapping
fn rebuild_remapping(&mut self, remapping: &VarRemapping) -> VarRemapping
Apply map_var_id to all the variable in the
remapping
.Source§fn rebuild_end(&mut self, end: &FlatBlockEnd) -> FlatBlockEnd
fn rebuild_end(&mut self, end: &FlatBlockEnd) -> FlatBlockEnd
Rebuilds the block end with renamed var and block ids.
Source§fn rebuild_block(&mut self, block: &FlatBlock) -> FlatBlock
fn rebuild_block(&mut self, block: &FlatBlock) -> FlatBlock
Rebuilds the block with renamed var and block ids.