[−][src]Struct rustc_mir::transform::early_otherwise_branch::EarlyOtherwiseBranch

pub struct EarlyOtherwiseBranch;

This pass optimizes something like

let x: Option<()>;
let y: Option<()>;
match (x,y) {
    (Some(_), Some(_)) => {0},
    _ => {1}
}

into something like

let x: Option<()>;
let y: Option<()>;
let discriminant_x = // get discriminant of x
let discriminant_y = // get discriminant of y
if discriminant_x != discriminant_y || discriminant_x == None {1} else {0}

Trait Implementations

impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch[src]

Auto Trait Implementations

impl RefUnwindSafe for EarlyOtherwiseBranch

impl Send for EarlyOtherwiseBranch

impl Sync for EarlyOtherwiseBranch

impl Unpin for EarlyOtherwiseBranch

impl UnwindSafe for EarlyOtherwiseBranch

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]