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
Field(Field, T)
Tuple Fields of Field
0: Field
1: T
These 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(Option<Symbol>, VariantIdx)
“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: VariantIdx
Implementations
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
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. 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.