struct ReconstructCtx<'a> {
cfg: CfgInfo,
body: &'a ExprBody,
break_context_depth: usize,
special_jump_stack: Vec<SpecialJump>,
mode: ReconstructMode,
}Fields§
§cfg: CfgInfo§body: &'a ExprBody§break_context_depth: usizeThe depth of loop contexts we may break/continue to.
special_jump_stack: Vec<SpecialJump>Stack of block ids that should be translated to special jumps (break/continue/do
nothing) in the current context.
The block where control-flow continues naturally after this block is kept at the top of the
stack.
mode: ReconstructModeImplementations§
Source§impl<'a> ReconstructCtx<'a>
impl<'a> ReconstructCtx<'a>
fn build( ctx: &TransformCtx, src_body: &'a ExprBody, ) -> Result<Self, Irreducible>
fn translate_statement(&self, st: &Statement) -> Statement
Sourcefn translate_jump(&mut self, span: Span, target_block: BlockId) -> Block
fn translate_jump(&mut self, span: Span, target_block: BlockId) -> Block
Translate a jump to the given block. The span is used to create the jump statement, if any.
fn translate_terminator(&mut self, terminator: &Terminator) -> Block
Sourcefn translate_block_itself(&mut self, block_id: BlockId) -> Block
fn translate_block_itself(&mut self, block_id: BlockId) -> Block
Translate just the block statements and terminator.
Sourcefn translate_block(&mut self, block_id: BlockId) -> Block
fn translate_block(&mut self, block_id: BlockId) -> Block
Translate a block including surrounding control-flow like looping.
fn translate_block_inner(&mut self, block_id: BlockId) -> Block
Auto Trait Implementations§
impl<'a> Freeze for ReconstructCtx<'a>
impl<'a> RefUnwindSafe for ReconstructCtx<'a>
impl<'a> Send for ReconstructCtx<'a>
impl<'a> Sync for ReconstructCtx<'a>
impl<'a> Unpin for ReconstructCtx<'a>
impl<'a> UnsafeUnpin for ReconstructCtx<'a>
impl<'a> UnwindSafe for ReconstructCtx<'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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more