pub enum Replacement {
LhsRhs {
statements: Arena<Statement>,
lhs: Infer,
rhs: Operand,
},
Cand {
statements: Arena<Statement>,
cand: Cand,
},
}
Expand description
A complete optimization that replaces a left-hand side with a right-hand side.
Variants§
LhsRhs
A replacement in the form of a left-hand side followed by a right-hand side.
Fields
Cand
A replacement in the form of an expression DAG followed by a cand x y
statement that declares that y
is a candidate for replacing x
.
Implementations§
Source§impl Replacement
impl Replacement
Sourcepub fn assignment(&self, id: ValueId) -> &Assignment
pub fn assignment(&self, id: ValueId) -> &Assignment
Get the assignment that defined the given value.
§Panics
May panic or produce incorrect results if given a ValueId
from another
Replacement
, LeftHandSide
, or RightHandSide
’s arena.
Trait Implementations§
Source§impl Clone for Replacement
impl Clone for Replacement
Source§fn clone(&self) -> Replacement
fn clone(&self) -> Replacement
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Replacement
impl Debug for Replacement
Source§impl Display for Replacement
impl Display for Replacement
Auto Trait Implementations§
impl Freeze for Replacement
impl RefUnwindSafe for Replacement
impl Send for Replacement
impl Sync for Replacement
impl Unpin for Replacement
impl UnwindSafe for Replacement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)