pub struct MirIfThenElse {
pub cond: Box<Spanned<MirExpr>>,
pub then_branch: Box<Spanned<MirExpr>>,
pub else_branch: Box<Spanned<MirExpr>>,
}Expand description
if cond { then_branch } else { else_branch } — direct
conditional, no pattern dispatch. Phase 6 wave 9 introduces
this so every backend gets it for free instead of
re-implementing the “two-arm bool match → if/else”
recognition (HIR’s try_emit_bool_if_else etc). The
optimizer pass bool_match_to_if rewrites qualifying
Match nodes into IfThenElse; backends consume only the
rewritten form.
Fields§
§cond: Box<Spanned<MirExpr>>§then_branch: Box<Spanned<MirExpr>>§else_branch: Box<Spanned<MirExpr>>Trait Implementations§
Source§impl Clone for MirIfThenElse
impl Clone for MirIfThenElse
Source§fn clone(&self) -> MirIfThenElse
fn clone(&self) -> MirIfThenElse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MirIfThenElse
impl RefUnwindSafe for MirIfThenElse
impl Send for MirIfThenElse
impl Sync for MirIfThenElse
impl Unpin for MirIfThenElse
impl UnsafeUnpin for MirIfThenElse
impl UnwindSafe for MirIfThenElse
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