rustc_utils::mir::location_or_arg::index

Struct LocationOrArgIndex

Source
pub struct LocationOrArgIndex { /* private fields */ }
Available on crate feature indexical only.

Implementations§

Source§

impl LocationOrArgIndex

Source

pub const MAX_INDEX: usize = 4_294_967_295usize

If Self::CHECKS_MAX_INDEX is true, we’ll assert if trying to produce a value larger than this in any of the ctors that don’t have unchecked in their name.

Source

pub const CHECKS_MAX_INDEX: bool = true

Does this index type assert if asked to construct an index larger than MAX_INDEX?

Source

pub fn new(value: usize) -> Self

Construct this index type from a usize. Alias for from_usize.

Source

pub fn from_raw(value: u32) -> Self

Construct this index type from the wrapped integer type.

Source

pub fn from_foreign<F: Idx>(value: F) -> Self

Construct this index type from one in a different domain

Source

pub const fn from_usize_unchecked(value: usize) -> Self

Construct from a usize without any checks.

Source

pub const fn from_raw_unchecked(raw: u32) -> Self

Construct from the underlying type without any checks.

Source

pub fn from_usize(value: usize) -> Self

Construct this index type from a usize.

Source

pub const fn index(self) -> usize

Get the wrapped index as a usize.

Source

pub const fn raw(self) -> u32

Get the wrapped index.

Source

pub fn check_index(v: usize)

Asserts v <= Self::MAX_INDEX unless Self::CHECKS_MAX_INDEX is false.

Trait Implementations§

Source§

impl Add<LocationOrArgIndex> for usize

Source§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
Source§

fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the + operation. Read more
Source§

impl Add<usize> for LocationOrArgIndex

Source§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
Source§

fn add(self, other: usize) -> Self

Performs the + operation. Read more
Source§

impl Add for LocationOrArgIndex

Source§

type Output = LocationOrArgIndex

The resulting type after applying the + operator.
Source§

fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the + operation. Read more
Source§

impl AddAssign<usize> for LocationOrArgIndex

Source§

fn add_assign(&mut self, other: usize)

Performs the += operation. Read more
Source§

impl AddAssign for LocationOrArgIndex

Source§

fn add_assign(&mut self, other: LocationOrArgIndex)

Performs the += operation. Read more
Source§

impl Clone for LocationOrArgIndex

Source§

fn clone(&self) -> LocationOrArgIndex

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocationOrArgIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<LocationOrArgIndex> for usize

Source§

fn from(v: LocationOrArgIndex) -> usize

Converts to this type from the input type.
Source§

impl From<usize> for LocationOrArgIndex

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl Hash for LocationOrArgIndex

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Idx for LocationOrArgIndex

Source§

fn from_usize(value: usize) -> Self

Construct an Index from a usize. This is equivalent to From<usize>. Read more
Source§

fn index(self) -> usize

Get the underlying index. This is equivalent to Into<usize>
Source§

impl Idx for LocationOrArgIndex

Source§

fn new(idx: usize) -> Self

Source§

fn index(self) -> usize

§

fn increment_by(&mut self, amount: usize)

§

fn plus(self, amount: usize) -> Self

Source§

impl Ord for LocationOrArgIndex

Source§

fn cmp(&self, other: &LocationOrArgIndex) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<LocationOrArgIndex> for usize

Source§

fn eq(&self, other: &LocationOrArgIndex) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<usize> for LocationOrArgIndex

Source§

fn eq(&self, other: &usize) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for LocationOrArgIndex

Source§

fn eq(&self, other: &LocationOrArgIndex) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<LocationOrArgIndex> for usize

Source§

fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<usize> for LocationOrArgIndex

Source§

fn partial_cmp(&self, other: &usize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for LocationOrArgIndex

Source§

fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem<usize> for LocationOrArgIndex

Source§

type Output = LocationOrArgIndex

The resulting type after applying the % operator.
Source§

fn rem(self, other: usize) -> Self

Performs the % operation. Read more
Source§

impl Sub<LocationOrArgIndex> for usize

Source§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
Source§

fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the - operation. Read more
Source§

impl Sub<usize> for LocationOrArgIndex

Source§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
Source§

fn sub(self, other: usize) -> Self

Performs the - operation. Read more
Source§

impl Sub for LocationOrArgIndex

Source§

type Output = LocationOrArgIndex

The resulting type after applying the - operator.
Source§

fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex

Performs the - operation. Read more
Source§

impl SubAssign<usize> for LocationOrArgIndex

Source§

fn sub_assign(&mut self, other: usize)

Performs the -= operation. Read more
Source§

impl SubAssign for LocationOrArgIndex

Source§

fn sub_assign(&mut self, other: LocationOrArgIndex)

Performs the -= operation. Read more
Source§

impl Copy for LocationOrArgIndex

Source§

impl Eq for LocationOrArgIndex

Source§

impl StructuralPartialEq for LocationOrArgIndex

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, T> IdxSliceIndex<I, T> for I
where I: Idx,

Source§

type Output = T

Source§

fn get( self, slice: &IndexSlice<I, [T]>, ) -> Option<&<I as IdxSliceIndex<I, T>>::Output>

Source§

fn get_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> Option<&mut <I as IdxSliceIndex<I, T>>::Output>

Source§

fn index( self, slice: &IndexSlice<I, [T]>, ) -> &<I as IdxSliceIndex<I, T>>::Output

Source§

fn index_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> &mut <I as IdxSliceIndex<I, T>>::Output

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.