rustc_middle::mir

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

§

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

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.

§

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

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

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

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

pub const fn len(&self) -> usize

pub const fn is_empty(&self) -> bool

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()).

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

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

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

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

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

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

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

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

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

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.

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>

§

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

§

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

Formats the value using the given formatter. Read more
§

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

§

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>)

§

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

§

type Output = T

The returned type after indexing.
§

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

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

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

§

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

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

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

§

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.
§

impl<I, T> ToOwned for IndexSlice<I, T>
where I: Idx, T: Clone,

§

type Owned = IndexVec<I, T>

The resulting type after obtaining ownership.
§

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

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

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

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

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

§

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

§

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)