Enum rustc::mir::ProjectionElem [] [src]

pub enum ProjectionElem<'tcx, V> {
    Deref,
    Field(FieldTy<'tcx>),
    Index(V),
    ConstantIndex {
        offset: u32,
        min_length: u32,
        from_end: bool,
    },
    Subslice {
        from: u32,
        to: u32,
    },
    Downcast(&'tcx AdtDefusize),
}
🔬 This is a nightly-only experimental API. (rustc_private)

Variants

🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (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

🔬 This is a nightly-only experimental API. (rustc_private)

index or -index (in Python terms), depending on from_end

🔬 This is a nightly-only experimental API. (rustc_private)

thing being indexed must be at least this long

🔬 This is a nightly-only experimental API. (rustc_private)

counting backwards from end?

🔬 This is a nightly-only experimental API. (rustc_private)

These indices are generated by slice patterns.

slice[from:-to] in Python terms.

Fields of Subslice

🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (rustc_private)
🔬 This is a nightly-only experimental API. (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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'tcx, V: Debug> Debug for ProjectionElem<'tcx, V>
[src]

Formats the value using the given formatter.

impl<'tcx, V: PartialEq> PartialEq for ProjectionElem<'tcx, V>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'tcx, V: Eq> Eq for ProjectionElem<'tcx, V>
[src]

impl<'tcx, V: Hash> Hash for ProjectionElem<'tcx, V>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<'tcx, V: Encodable> Encodable for ProjectionElem<'tcx, V>
[src]

🔬 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]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io