Struct rustc_utils::mir::location_or_arg::index::LocationOrArgIndex
source · pub struct LocationOrArgIndex { /* private fields */ }
Available on crate feature
indexical
only.Implementations§
source§impl LocationOrArgIndex
impl LocationOrArgIndex
sourcepub const MAX_INDEX: usize = 4_294_967_295usize
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.
sourcepub const CHECKS_MAX_INDEX: bool = true
pub const CHECKS_MAX_INDEX: bool = true
Does this index type assert if asked to construct an index larger than MAX_INDEX?
sourcepub fn from_foreign<F: Idx>(value: F) -> Self
pub fn from_foreign<F: Idx>(value: F) -> Self
Construct this index type from one in a different domain
sourcepub const fn from_usize_unchecked(value: usize) -> Self
pub const fn from_usize_unchecked(value: usize) -> Self
Construct from a usize without any checks.
sourcepub const fn from_raw_unchecked(raw: u32) -> Self
pub const fn from_raw_unchecked(raw: u32) -> Self
Construct from the underlying type without any checks.
sourcepub fn from_usize(value: usize) -> Self
pub fn from_usize(value: usize) -> Self
Construct this index type from a usize.
sourcepub fn check_index(v: usize)
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
impl Add<LocationOrArgIndex> for usize
§type Output = LocationOrArgIndex
type Output = LocationOrArgIndex
The resulting type after applying the
+
operator.source§fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex
fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex
Performs the
+
operation. Read moresource§impl Add<usize> for LocationOrArgIndex
impl Add<usize> for LocationOrArgIndex
source§impl Add for LocationOrArgIndex
impl Add for LocationOrArgIndex
§type Output = LocationOrArgIndex
type Output = LocationOrArgIndex
The resulting type after applying the
+
operator.source§fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex
fn add(self, other: LocationOrArgIndex) -> LocationOrArgIndex
Performs the
+
operation. Read moresource§impl AddAssign<usize> for LocationOrArgIndex
impl AddAssign<usize> for LocationOrArgIndex
source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
Performs the
+=
operation. Read moresource§impl AddAssign for LocationOrArgIndex
impl AddAssign for LocationOrArgIndex
source§fn add_assign(&mut self, other: LocationOrArgIndex)
fn add_assign(&mut self, other: LocationOrArgIndex)
Performs the
+=
operation. Read moresource§impl Clone for LocationOrArgIndex
impl Clone for LocationOrArgIndex
source§fn clone(&self) -> LocationOrArgIndex
fn clone(&self) -> LocationOrArgIndex
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 LocationOrArgIndex
impl Debug for LocationOrArgIndex
source§impl From<LocationOrArgIndex> for usize
impl From<LocationOrArgIndex> for usize
source§fn from(v: LocationOrArgIndex) -> usize
fn from(v: LocationOrArgIndex) -> usize
Converts to this type from the input type.
source§impl From<usize> for LocationOrArgIndex
impl From<usize> for LocationOrArgIndex
source§impl Hash for LocationOrArgIndex
impl Hash for LocationOrArgIndex
source§impl Idx for LocationOrArgIndex
impl Idx for LocationOrArgIndex
source§impl Idx for LocationOrArgIndex
impl Idx for LocationOrArgIndex
source§impl Ord for LocationOrArgIndex
impl Ord for LocationOrArgIndex
source§fn cmp(&self, other: &LocationOrArgIndex) -> Ordering
fn cmp(&self, other: &LocationOrArgIndex) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<LocationOrArgIndex> for usize
impl PartialEq<LocationOrArgIndex> for usize
source§fn eq(&self, other: &LocationOrArgIndex) -> bool
fn eq(&self, other: &LocationOrArgIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<usize> for LocationOrArgIndex
impl PartialEq<usize> for LocationOrArgIndex
source§impl PartialEq for LocationOrArgIndex
impl PartialEq for LocationOrArgIndex
source§fn eq(&self, other: &LocationOrArgIndex) -> bool
fn eq(&self, other: &LocationOrArgIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<LocationOrArgIndex> for usize
impl PartialOrd<LocationOrArgIndex> for usize
source§fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<usize> for LocationOrArgIndex
impl PartialOrd<usize> for LocationOrArgIndex
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for LocationOrArgIndex
impl PartialOrd for LocationOrArgIndex
source§fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &LocationOrArgIndex) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Rem<usize> for LocationOrArgIndex
impl Rem<usize> for LocationOrArgIndex
source§impl Sub<LocationOrArgIndex> for usize
impl Sub<LocationOrArgIndex> for usize
§type Output = LocationOrArgIndex
type Output = LocationOrArgIndex
The resulting type after applying the
-
operator.source§fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex
fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex
Performs the
-
operation. Read moresource§impl Sub<usize> for LocationOrArgIndex
impl Sub<usize> for LocationOrArgIndex
source§impl Sub for LocationOrArgIndex
impl Sub for LocationOrArgIndex
§type Output = LocationOrArgIndex
type Output = LocationOrArgIndex
The resulting type after applying the
-
operator.source§fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex
fn sub(self, other: LocationOrArgIndex) -> LocationOrArgIndex
Performs the
-
operation. Read moresource§impl SubAssign<usize> for LocationOrArgIndex
impl SubAssign<usize> for LocationOrArgIndex
source§fn sub_assign(&mut self, other: usize)
fn sub_assign(&mut self, other: usize)
Performs the
-=
operation. Read moresource§impl SubAssign for LocationOrArgIndex
impl SubAssign for LocationOrArgIndex
source§fn sub_assign(&mut self, other: LocationOrArgIndex)
fn sub_assign(&mut self, other: LocationOrArgIndex)
Performs the
-=
operation. Read moreimpl Copy for LocationOrArgIndex
impl Eq for LocationOrArgIndex
impl StructuralEq for LocationOrArgIndex
impl StructuralPartialEq for LocationOrArgIndex
Auto Trait Implementations§
impl RefUnwindSafe for LocationOrArgIndex
impl Send for LocationOrArgIndex
impl Sync for LocationOrArgIndex
impl Unpin for LocationOrArgIndex
impl UnwindSafe for LocationOrArgIndex
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