Type Alias LocalDecls

Source
pub type LocalDecls<'tcx> = IndexSlice<Local, LocalDecl<'tcx>>;
Expand description

Types for locals

Aliased Type§

struct LocalDecls<'tcx> {
    pub raw: [LocalDecl<'tcx>],
    /* private fields */
}

Fields§

§raw: [LocalDecl<'tcx>]

Implementations

Source§

impl<I, J> IndexSlice<I, J>
where I: Idx, J: Idx,

Source

pub fn invert_bijective_mapping(&self) -> IndexVec<J, I>

Invert a bijective mapping, i.e. invert(map)[y] = x if map[x] = y, assuming the values in self are a permutation of 0..self.len().

This is used to go between memory_index (source field order to memory order) and inverse_memory_index (memory order to source field order). See also FieldsShape::Arbitrary::memory_index for more details.

Source§

impl<I, T> IndexSlice<I, T>
where I: Idx,

Source

pub const fn empty<'a>() -> &'a IndexSlice<I, T>

Source

pub const fn from_raw(raw: &[T]) -> &IndexSlice<I, T>

Source

pub fn from_raw_mut(raw: &mut [T]) -> &mut IndexSlice<I, T>

Source

pub const fn len(&self) -> usize

Source

pub const fn is_empty(&self) -> bool

Source

pub fn next_index(&self) -> I

Gives the next index that will be assigned when push is called.

Manual bounds checks can be done using idx < slice.next_index() (as opposed to idx.index() < slice.len()).

Source

pub fn iter(&self) -> Iter<'_, T>

Source

pub fn iter_enumerated(&self) -> impl DoubleEndedIterator + ExactSizeIterator

Source

pub fn indices( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator + Clone + 'static

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Source

pub fn iter_enumerated_mut( &mut self, ) -> impl DoubleEndedIterator + ExactSizeIterator

Source

pub fn last_index(&self) -> Option<I>

Source

pub fn swap(&mut self, a: I, b: I)

Source

pub fn get(&self, index: I) -> Option<&T>

Source

pub fn get_mut(&mut self, index: I) -> Option<&mut T>

Source

pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T)

Returns mutable references to two distinct elements, a and b.

Panics if a == b.

Source

pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T)

Returns mutable references to three distinct elements.

Panics if the elements are not distinct.

Trait Implementations§

Source§

impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx>

Source§

fn local_decls(&self) -> &LocalDecls<'tcx>

Source§

impl<I, T> Debug for IndexSlice<I, T>
where I: Idx, T: Debug,

Source§

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

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

impl<I, T> Hash for IndexSlice<I, T>
where I: Hash + Idx, T: Hash,

Source§

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

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

impl<I, T, CTX> HashStable<CTX> for IndexSlice<I, T>
where I: Idx, T: HashStable<CTX>,

Source§

fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher<SipHasher128>)

Source§

impl<I, T> Index<I> for IndexSlice<I, T>
where I: Idx,

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: I) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<I> for IndexSlice<I, T>
where I: Idx,

Source§

fn index_mut(&mut self, index: I) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> PartialEq for IndexSlice<I, T>
where I: PartialEq + Idx, T: PartialEq,

Source§

fn eq(&self, other: &IndexSlice<I, T>) -> 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<I, T> ToOwned for IndexSlice<I, T>
where I: Idx, T: Clone,

Source§

type Owned = IndexVec<I, T>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> IndexVec<I, T>

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

fn clone_into(&self, target: &mut IndexVec<I, T>)

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

impl<I, T> Eq for IndexSlice<I, T>
where I: Eq + Idx, T: Eq,

Source§

impl<I, T> Send for IndexSlice<I, T>
where I: Idx, T: Send,

Source§

impl<I, T> StructuralPartialEq for IndexSlice<I, T>
where I: Idx,

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: (unsized)