[−][src]Struct rustc_mir::transform::early_otherwise_branch::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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.