[−][src]Enum rustc_mir_build::thir::pattern::_match::SpecializationCache

enum SpecializationCache {
    Variants {
        lookup: FxHashMap<DefId, SmallVec<[usize; 1]>>,
        wilds: SmallVec<[usize; 1]>,
    },
    Incompatible,
}

Depending on the match patterns, the specialization process might be able to use a fast path. Tracks whether we can use the fast path and the lookup table needed in those cases.

Variants

Variants

Patterns consist of only enum variants. Variant patterns does not intersect with each other (in contrast to range patterns), so it is possible to precompute the result of Matrix::specialize_constructor at a lower computational complexity. lookup is responsible for holding the precomputed result of Matrix::specialize_constructor, while wilds is used for two purposes: the first one is the precomputed result of Matrix::specialize_wildcard, and the second is to be used as a fallback for Matrix::specialize_constructor when it tries to apply a constructor that has not been seen in the Matrix. See update_cache for further explanations.

Fields of Variants

lookup: FxHashMap<DefId, SmallVec<[usize; 1]>>wilds: SmallVec<[usize; 1]>
Incompatible

Does not belong to the cases above, use the slow path.

Trait Implementations

impl Clone for SpecializationCache[src]

impl Debug for SpecializationCache[src]

impl PartialEq<SpecializationCache> for SpecializationCache[src]

impl StructuralPartialEq for SpecializationCache[src]

Auto Trait Implementations

impl RefUnwindSafe for SpecializationCache

impl Send for SpecializationCache

impl Sync for SpecializationCache

impl Unpin for SpecializationCache

impl UnwindSafe for SpecializationCache

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.