Enum rustc_middle::mir::ProjectionElem [−][src]
pub enum ProjectionElem<V, T> {
Deref,
Field(Field, T),
Index(V),
ConstantIndex {
offset: u64,
min_length: u64,
from_end: bool,
},
Subslice {
from: u64,
to: u64,
from_end: bool,
},
Downcast(Option<Symbol>, VariantIdx),
}Variants
Tuple Fields of Field
0: Field1: TThese indices are generated by slice patterns. Easiest to explain by example:
[X, _, .._, _, _] => { offset: 0, min_length: 4, from_end: false }, [_, X, .._, _, _] => { offset: 1, min_length: 4, from_end: false }, [_, _, .._, X, _] => { offset: 2, min_length: 4, from_end: true }, [_, _, .._, _, X] => { offset: 1, min_length: 4, from_end: true },
Fields of ConstantIndex
These indices are generated by slice patterns.
If from_end is true slice[from..slice.len() - to].
Otherwise array[from..to].
Fields of Subslice
“Downcast” to a variant of an ADT. Currently, we only introduce this for ADTs with more than one variant. It may be better to just introduce it always, or always for enums.
The included Symbol is the name of the variant, used for printing MIR.
Tuple Fields of Downcast
0: Option<Symbol>1: VariantIdxImplementations
Returns true if the target of this projection may refer to a different region of memory
than the base.
Trait Implementations
impl<'__ctx, V, T> HashStable<StableHashingContext<'__ctx>> for ProjectionElem<V, T> where
T: HashStable<StableHashingContext<'__ctx>>,
V: HashStable<StableHashingContext<'__ctx>>,
impl<'__ctx, V, T> HashStable<StableHashingContext<'__ctx>> for ProjectionElem<V, T> where
T: HashStable<StableHashingContext<'__ctx>>,
V: HashStable<StableHashingContext<'__ctx>>,
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl<V, T> RefUnwindSafe for ProjectionElem<V, T> where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, T> Send for ProjectionElem<V, T> where
T: Send,
V: Send,
impl<V, T> Sync for ProjectionElem<V, T> where
T: Sync,
V: Sync,
impl<V, T> Unpin for ProjectionElem<V, T> where
T: Unpin,
V: Unpin,
impl<V, T> UnwindSafe for ProjectionElem<V, T> where
T: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.