pub enum RerunCondition<I: Interner> {
Never,
AnyOpaqueHasInferAsHidden,
OpaqueInStorage(SmallCopyList<I::LocalDefId>),
OpaqueInStorageOrAnyOpaqueHasInferAsHidden(SmallCopyList<I::LocalDefId>),
Always,
}Expand description
Information about how we accessed opaque types This is what the trait solver does when each states is encountered:
| bail? | rerun goal? | |
|---|---|---|
| never | no | no |
| always | yes | yes |
| [defid in storage] | no | only if any of the defids in the list is in the opaque type storage OR if TypingMode::PostAnalysis |
| opaque with hidden type | no | only if any of the the opaques in the opaque type storage has a hidden type in this list AND if TypingMode::Analysis |
-
“bail” is implemented with
should_bail. If true, we’re abandoning our attempt to canonicalize inTypingMode::ErasedNotCoherence, and should try to return as soon as possible to waste as little time as possible. A rerun will be attempted in the original typing mode. -
Rerun goal is implemented with
should_rerun_after_erased_canonicalization, on theEvalCtxt.
Some variant names contain an Or here. They rerun when any of the two conditions applies
Variants§
Never
AnyOpaqueHasInferAsHidden
Note that this only reruns according to the condition if we are in TypingMode::Analysis.
OpaqueInStorage(SmallCopyList<I::LocalDefId>)
Note: unconditionally reruns in postanalysis
OpaqueInStorageOrAnyOpaqueHasInferAsHidden(SmallCopyList<I::LocalDefId>)
Merges Self::AnyOpaqueHasInferAsHidden and Self::OpaqueInStorage.
Note that just like the unmerged Self::OpaqueInStorage, that part of the
condition only matters in TypingMode::Analysis
Always
Implementations§
Source§impl<I: Interner> RerunCondition<I>
impl<I: Interner> RerunCondition<I>
Sourcefn merge(self, other: Self) -> Self
fn merge(self, other: Self) -> Self
Merge two rerun states according to the following transition diagram
(some cells are empty because the table is symmetric, i.e. a.merge(b) == b.merge(a)).
- “self” here means the current state, i.e. the state of the current column
- square brackets represents that this is a list of things. Even if the state doesn’t change, we might grow the list to effectively end up in a different state anyway
[o. in s.]abbreviates “opaque in storage”
| never | always | [opaque in storage] | opaque has infer as hidden | [o. in s.] or i. as hidden | |
|---|---|---|---|---|---|
| never | self | self | self | self | self |
| always | always | always | always | always | |
| [opaque in storage] | concat self | [o. in s.] or i. as hidden | concat to self | ||
| opaque has infer as hidden type | self | to self |
fn should_bail(&self) -> Result<(), RerunNonErased>
Sourcefn might_rerun(&self) -> bool
fn might_rerun(&self) -> bool
Returns true when any access of opaques was attempted.
i.e. when self != Self::Never
Trait Implementations§
Source§impl<I> Clone for RerunCondition<I>where
I: Interner,
impl<I> Clone for RerunCondition<I>where
I: Interner,
Source§impl<I> Debug for RerunCondition<I>where
I: Interner,
impl<I> Debug for RerunCondition<I>where
I: Interner,
Source§impl<I> Hash for RerunCondition<I>where
I: Interner,
impl<I> Hash for RerunCondition<I>where
I: Interner,
Source§impl<I> PartialEq for RerunCondition<I>where
I: Interner,
impl<I> PartialEq for RerunCondition<I>where
I: Interner,
Source§impl<I: Interner> StableHash for RerunCondition<I>
impl<I: Interner> StableHash for RerunCondition<I>
fn stable_hash<__Hcx: StableHashCtxt>( &self, __hcx: &mut __Hcx, __hasher: &mut StableHasher, )
Source§impl<I> TypeFoldable<I> for RerunCondition<I>
impl<I> TypeFoldable<I> for RerunCondition<I>
Source§fn try_fold_with<__F: FallibleTypeFolder<I>>(
self,
__folder: &mut __F,
) -> Result<Self, __F::Error>
fn try_fold_with<__F: FallibleTypeFolder<I>>( self, __folder: &mut __F, ) -> Result<Self, __F::Error>
Source§impl<I> TypeVisitable<I> for RerunCondition<I>
impl<I> TypeVisitable<I> for RerunCondition<I>
Source§fn visit_with<__V: TypeVisitor<I>>(&self, __visitor: &mut __V) -> __V::Result
fn visit_with<__V: TypeVisitor<I>>(&self, __visitor: &mut __V) -> __V::Result
impl<I> Copy for RerunCondition<I>where
I: Interner,
impl<I> Eq for RerunCondition<I>where
I: Interner,
Auto Trait Implementations§
impl<I> DynSend for RerunCondition<I>
impl<I> DynSync for RerunCondition<I>
impl<I> Freeze for RerunCondition<I>
impl<I> RefUnwindSafe for RerunCondition<I>
impl<I> Send for RerunCondition<I>
impl<I> Sync for RerunCondition<I>
impl<I> Unpin for RerunCondition<I>
impl<I> UnsafeUnpin for RerunCondition<I>
impl<I> UnwindSafe for RerunCondition<I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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.