Enum rustc_infer::traits::EvaluationResult
source · pub enum EvaluationResult {
EvaluatedToOk,
EvaluatedToOkModuloRegions,
EvaluatedToOkModuloOpaqueTypes,
EvaluatedToAmbig,
EvaluatedToAmbigStackDependent,
EvaluatedToErr,
}
Expand description
The result of trait evaluation. The order is important here as the evaluation of a list is the maximum of the evaluations.
The evaluation results are ordered:
- EvaluatedToOk
implies EvaluatedToOkModuloRegions
implies EvaluatedToAmbig
implies EvaluatedToAmbigStackDependent
- the “union” of evaluation results is equal to their maximum -
all the “potential success” candidates can potentially succeed,
so they are noops when unioned with a definite error, and within
the categories it’s easy to see that the unions are correct.
Variants§
EvaluatedToOk
Evaluation successful.
EvaluatedToOkModuloRegions
Evaluation successful, but there were unevaluated region obligations.
EvaluatedToOkModuloOpaqueTypes
Evaluation successful, but need to rerun because opaque types got hidden types assigned without it being known whether the opaque types are within their defining scope
EvaluatedToAmbig
Evaluation is known to be ambiguous – it might hold for some assignment of inference variables, but it might not.
While this has the same meaning as EvaluatedToAmbigStackDependent
– we can’t
know whether this obligation holds or not – it is the result we
would get with an empty stack, and therefore is cacheable.
EvaluatedToAmbigStackDependent
Evaluation failed because of recursion involving inference variables. We are somewhat imprecise there, so we don’t actually know the real result.
This can’t be trivially cached because the result depends on the stack results.
EvaluatedToErr
Evaluation failed.
Implementations§
source§impl EvaluationResult
impl EvaluationResult
sourcepub fn must_apply_considering_regions(self) -> bool
pub fn must_apply_considering_regions(self) -> bool
Returns true
if this evaluation result is known to apply, even
considering outlives constraints.
sourcepub fn must_apply_modulo_regions(self) -> bool
pub fn must_apply_modulo_regions(self) -> bool
Returns true
if this evaluation result is known to apply, ignoring
outlives constraints.
pub fn may_apply(self) -> bool
pub fn is_stack_dependent(self) -> bool
Trait Implementations§
source§impl Clone for EvaluationResult
impl Clone for EvaluationResult
source§fn clone(&self) -> EvaluationResult
fn clone(&self) -> EvaluationResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EvaluationResult
impl Debug for EvaluationResult
source§impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for EvaluationResult
impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for EvaluationResult
fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher<SipHasher128>, )
source§impl Ord for EvaluationResult
impl Ord for EvaluationResult
source§fn cmp(&self, other: &EvaluationResult) -> Ordering
fn cmp(&self, other: &EvaluationResult) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for EvaluationResult
impl PartialEq for EvaluationResult
source§fn eq(&self, other: &EvaluationResult) -> bool
fn eq(&self, other: &EvaluationResult) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for EvaluationResult
impl PartialOrd for EvaluationResult
source§fn partial_cmp(&self, other: &EvaluationResult) -> Option<Ordering>
fn partial_cmp(&self, other: &EvaluationResult) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for EvaluationResult
impl Eq for EvaluationResult
impl StructuralPartialEq for EvaluationResult
Auto Trait Implementations§
impl DynSend for EvaluationResult
impl DynSync for EvaluationResult
impl Freeze for EvaluationResult
impl RefUnwindSafe for EvaluationResult
impl Send for EvaluationResult
impl Sync for EvaluationResult
impl Unpin for EvaluationResult
impl UnwindSafe for EvaluationResult
Blanket Implementations§
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'a mut [T]
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'a mut [T]
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Tcx, T> DepNodeParams<Tcx> for T
impl<Tcx, T> DepNodeParams<Tcx> for T
default fn fingerprint_style() -> FingerprintStyle
source§default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_debug_str(&self, _: Tcx) -> String
source§default fn recover(_: Tcx, _: &DepNode) -> Option<T>
default fn recover(_: Tcx, _: &DepNode) -> Option<T>
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.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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§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<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> 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<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
EvaluatedToOk
: 0 bytesEvaluatedToOkModuloRegions
: 0 bytesEvaluatedToOkModuloOpaqueTypes
: 0 bytesEvaluatedToAmbig
: 0 bytesEvaluatedToAmbigStackDependent
: 0 bytesEvaluatedToErr
: 0 bytes