flowistry_pdg::rustc::mir

Enum BinOp

Source
pub enum BinOp {
Show 26 variants Add, AddUnchecked, AddWithOverflow, Sub, SubUnchecked, SubWithOverflow, Mul, MulUnchecked, MulWithOverflow, Div, Rem, BitXor, BitAnd, BitOr, Shl, ShlUnchecked, Shr, ShrUnchecked, Eq, Lt, Le, Ne, Ge, Gt, Cmp, Offset,
}

Variants§

§

Add

The + operator (addition)

§

AddUnchecked

Like Add, but with UB on overflow. (Integers only.)

§

AddWithOverflow

Like Add, but returns (T, bool) of both the wrapped result and a bool indicating whether it overflowed.

§

Sub

The - operator (subtraction)

§

SubUnchecked

Like Sub, but with UB on overflow. (Integers only.)

§

SubWithOverflow

Like Sub, but returns (T, bool) of both the wrapped result and a bool indicating whether it overflowed.

§

Mul

The * operator (multiplication)

§

MulUnchecked

Like Mul, but with UB on overflow. (Integers only.)

§

MulWithOverflow

Like Mul, but returns (T, bool) of both the wrapped result and a bool indicating whether it overflowed.

§

Div

The / operator (division)

For integer types, division by zero is UB, as is MIN / -1 for signed. The compiler should have inserted checks prior to this.

Floating-point division by zero is safe, and does not need guards.

§

Rem

The % operator (modulus)

For integer types, using zero as the modulus (second operand) is UB, as is MIN % -1 for signed. The compiler should have inserted checks prior to this.

Floating-point remainder by zero is safe, and does not need guards.

§

BitXor

The ^ operator (bitwise xor)

§

BitAnd

The & operator (bitwise and)

§

BitOr

The | operator (bitwise or)

§

Shl

The << operator (shift left)

The offset is given by RHS.rem_euclid(LHS::BITS). In other words, it is (uniquely) determined as follows:

  • it is “equal modulo LHS::BITS” to the RHS
  • it is in the range 0..LHS::BITS
§

ShlUnchecked

Like Shl, but is UB if the RHS >= LHS::BITS or RHS < 0

§

Shr

The >> operator (shift right)

The offset is given by RHS.rem_euclid(LHS::BITS). In other words, it is (uniquely) determined as follows:

  • it is “equal modulo LHS::BITS” to the RHS
  • it is in the range 0..LHS::BITS

This is an arithmetic shift if the LHS is signed and a logical shift if the LHS is unsigned.

§

ShrUnchecked

Like Shl, but is UB if the RHS >= LHS::BITS or RHS < 0

§

Eq

The == operator (equality)

§

Lt

The < operator (less than)

§

Le

The <= operator (less than or equal to)

§

Ne

The != operator (not equal to)

§

Ge

The >= operator (greater than or equal to)

§

Gt

The > operator (greater than)

§

Cmp

The <=> operator (three-way comparison, like Ord::cmp)

This is supported only on the integer types and char, always returning [rustc_hir::LangItem::OrderingEnum] (aka std::cmp::Ordering).

Rvalue::BinaryOp(BinOp::Cmp, A, B) returns

  • Ordering::Less (-1_i8, as a Scalar) if A < B
  • Ordering::Equal (0_i8, as a Scalar) if A == B
  • Ordering::Greater (+1_i8, as a Scalar) if A > B
§

Offset

The ptr.offset operator

Auto Trait Implementations§

§

impl Freeze for BinOp

§

impl RefUnwindSafe for BinOp

§

impl Send for BinOp

§

impl Sync for BinOp

§

impl Unpin for BinOp

§

impl UnwindSafe for BinOp

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.