pub struct Mapper<'a, 'b> { /* private fields */ }
Expand description

Context for mapping ids from lowered to a new FlatLowered object.

Trait Implementations§

source§

impl<'a, 'b> Rebuilder for Mapper<'a, 'b>

source§

fn map_var_id(&mut self, orig_var_id: VariableId) -> VariableId

Maps a var id from the original lowering representation to the equivalent id in the new lowering representation. If the variable wasn’t assigned an id yet, a new id is assigned.

source§

fn map_block_id(&mut self, orig_block_id: BlockId) -> BlockId

Maps a block id from the original lowering representation to the equivalent id in the new lowering representation.

source§

fn transform_end(&mut self, end: &mut FlatBlockEnd)

source§

fn map_var_usage(&mut self, var_usage: VarUsage) -> VarUsage

source§

fn transform_statement(&mut self, _statement: &mut Statement)

source§

fn transform_remapping(&mut self, _remapping: &mut VarRemapping)

source§

fn transform_block(&mut self, _block: &mut FlatBlock)

Auto Trait Implementations§

§

impl<'a, 'b> !RefUnwindSafe for Mapper<'a, 'b>

§

impl<'a, 'b> !Send for Mapper<'a, 'b>

§

impl<'a, 'b> !Sync for Mapper<'a, 'b>

§

impl<'a, 'b> Unpin for Mapper<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for Mapper<'a, 'b>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> RebuilderEx for Twhere T: Rebuilder,

source§

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

Apply map_var_id to all the variable in the remapping.
source§

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

Rebuilds the block with renamed var and block ids.
source§

impl<T0, T1, E, TRewriter> SemanticRewriter<(T0, T1), E> for TRewriterwhere TRewriter: SemanticRewriter<T0, E> + SemanticRewriter<T1, E>,

source§

fn rewrite(&mut self, value: (T0, T1)) -> Result<(T0, T1), E>

source§

impl<T, E, TRewriter> SemanticRewriter<Box<T, Global>, E> for TRewriterwhere T: Clone, TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Box<T, Global>) -> Result<Box<T, Global>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Option<T>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Option<T>) -> Result<Option<T>, E>

source§

impl<T, E, TRewriter, E2> SemanticRewriter<Result<T, E2>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Result<T, E2>) -> Result<Result<T, E2>, E>

source§

impl<T, E, TRewriter> SemanticRewriter<Vec<T, Global>, E> for TRewriterwhere TRewriter: SemanticRewriter<T, E>,

source§

fn rewrite(&mut self, value: Vec<T, Global>) -> Result<Vec<T, Global>, E>

source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> Upcast<T> for Twhere T: ?Sized,

source§

fn upcast(&self) -> &T

source§

impl<T> UpcastMut<T> for Twhere T: ?Sized,

source§

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