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>
impl<I, J> IndexSlice<I, J>
Sourcepub fn invert_bijective_mapping(&self) -> IndexVec<J, I>
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,
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
Sourcepub fn next_index(&self) -> I
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>
Sourcepub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &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
.
Sourcepub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T)
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.
pub fn binary_search(&self, value: &T) -> Result<I, I>where
T: Ord,
Trait Implementations§
Source§impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx>
impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx>
fn local_decls(&self) -> &LocalDecls<'tcx>
Source§impl<I, T> Debug for IndexSlice<I, T>
impl<I, T> Debug for IndexSlice<I, T>
Source§impl<I, T> Hash for IndexSlice<I, T>
impl<I, T> Hash for IndexSlice<I, T>
Source§impl<I, T, CTX> HashStable<CTX> for IndexSlice<I, T>where
I: Idx,
T: HashStable<CTX>,
impl<I, T, CTX> HashStable<CTX> for IndexSlice<I, T>where
I: Idx,
T: HashStable<CTX>,
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher<SipHasher128>)
Source§impl<I, T> Index<I> for IndexSlice<I, T>where
I: Idx,
impl<I, T> Index<I> for IndexSlice<I, T>where
I: Idx,
Source§impl<I, T> IndexMut<I> for IndexSlice<I, T>where
I: Idx,
impl<I, T> IndexMut<I> for IndexSlice<I, T>where
I: Idx,
Source§impl<I, T> PartialEq for IndexSlice<I, T>
impl<I, T> PartialEq for IndexSlice<I, T>
Source§impl<I, T> ToOwned for IndexSlice<I, T>
impl<I, T> ToOwned for IndexSlice<I, T>
impl<I, T> Eq for IndexSlice<I, T>
impl<I, T> Send for IndexSlice<I, T>
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)