Enum rustc::mir::ProjectionElem
[−]
[src]
pub enum ProjectionElem<'tcx, V> { Deref, Field(Field, Ty<'tcx>), Index(V), ConstantIndex { offset: u32, min_length: u32, from_end: bool, }, Subslice { from: u32, to: u32, }, Downcast(&'tcx AdtDef, usize), }
rustc_private
)Variants
Deref
rustc_private
)Field(Field, Ty<'tcx>)
rustc_private
)Index(V)
rustc_private
)ConstantIndex
rustc_private
)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
offset: u32 | 🔬 This is a nightly-only experimental API. ( rustc_private )index or -index (in Python terms), depending on from_end |
min_length: u32 | 🔬 This is a nightly-only experimental API. ( rustc_private )thing being indexed must be at least this long |
from_end: bool | 🔬 This is a nightly-only experimental API. ( rustc_private )counting backwards from end? |
Subslice
rustc_private
)These indices are generated by slice patterns.
slice[from:-to] in Python terms.
Fields of Subslice
from: u32 | 🔬 This is a nightly-only experimental API. ( rustc_private ) |
to: u32 | 🔬 This is a nightly-only experimental API. ( rustc_private ) |
Downcast(&'tcx AdtDef, usize)
rustc_private
)"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.
Trait Implementations
impl<'tcx, V: Clone> Clone for ProjectionElem<'tcx, V>
[src]
fn clone(&self) -> ProjectionElem<'tcx, V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'tcx, V: Debug> Debug for ProjectionElem<'tcx, V>
[src]
impl<'tcx, V: PartialEq> PartialEq for ProjectionElem<'tcx, V>
[src]
fn eq(&self, __arg_0: &ProjectionElem<'tcx, V>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ProjectionElem<'tcx, V>) -> bool
This method tests for !=
.
impl<'tcx, V: Eq> Eq for ProjectionElem<'tcx, V>
[src]
impl<'tcx, V: Hash> Hash for ProjectionElem<'tcx, V>
[src]
fn hash<__HV: Hasher>(&self, __arg_0: &mut __HV)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<'tcx, V: Encodable> Encodable for ProjectionElem<'tcx, V>
[src]
fn encode<__SV: Encoder>(&self, __arg_0: &mut __SV) -> Result<(), __SV::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx, V: Decodable> Decodable for ProjectionElem<'tcx, V>
[src]
fn decode<__DV: Decoder>(__arg_0: &mut __DV)
-> Result<ProjectionElem<'tcx, V>, __DV::Error>
-> Result<ProjectionElem<'tcx, V>, __DV::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io