pub(super) struct StackEntry<X: Cx> {
pub input: X::Input,
pub step_kind_from_parent: PathKind,
pub available_depth: AvailableDepth,
pub min_reached_available_depth: AvailableDepth,
pub increase_depth_for_nested: IncreaseDepthForNested,
pub provisional_result: Option<X::Result>,
pub heads: CycleHeads,
pub encountered_overflow: bool,
pub usages: Option<HeadUsages>,
pub candidate_usages: Option<CandidateHeadUsages>,
pub nested_goals: NestedGoals<X>,
}Expand description
Stack entries of the evaluation stack. Its fields tend to be lazily updated when popping a child goal or completely immutable.
Fields§
§input: X::Input§step_kind_from_parent: PathKindWhether proving this goal is a coinductive step.
This is used when encountering a trait solver cycle to decide whether the initial provisional result of the cycle.
available_depth: AvailableDepthThe available depth of a given goal, immutable.
min_reached_available_depth: AvailableDepthThe minimum available depth encountered while evaluating this goal’s nested goals.
If there’s no nested goal, this is equal to the available_depth.
increase_depth_for_nested: IncreaseDepthForNestedWhether evaluating nested goals of a given goal should increase the depth.
Normally, it should be Yes, but among rustc’s predicate goals, normalizes-to
goals are exceptions. They act like functions that used for normalizing associated
terms while evaluating projection goals and since their expected terms are always fully
unconstrained intentionally, they often return ambiguous nested goals to the caller’s
context. As these nested goals are evaluated again in the caller’s context, we don’t
want to increase depths when they are evaluated as nested goals for normalizes-to
goals, otherwise we will encounter recursion limit overflows more often.
provisional_result: Option<X::Result>Starts out as None and gets set when rerunning this
goal in case we encounter a cycle.
heads: CycleHeadsAll cycle heads this goal depends on. Lazily updated and only up-to date for the top of the stack.
encountered_overflow: boolWhether evaluating this goal encountered overflow. Lazily updated.
usages: Option<HeadUsages>Whether and how this goal has been used as a cycle head. Lazily updated.
candidate_usages: Option<CandidateHeadUsages>We want to be able to ignore head usages if they happen inside of candidates which don’t impact the result of a goal. This enables us to avoid rerunning goals and is also used when rebasing provisional cache entries.
To implement this, we track all usages while evaluating a candidate. If this candidate
then ends up ignored, we manually remove its usages from usages and heads.
nested_goals: NestedGoals<X>The nested goals of this goal, see the doc comment of the type.
Implementations§
Source§impl<X: Cx> StackEntry<X>
impl<X: Cx> StackEntry<X>
pub(super) fn required_depth(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<X> DynSend for StackEntry<X>
impl<X> DynSync for StackEntry<X>
impl<X> Freeze for StackEntry<X>
impl<X> RefUnwindSafe for StackEntry<X>
impl<X> Send for StackEntry<X>
impl<X> Sync for StackEntry<X>
impl<X> Unpin for StackEntry<X>
impl<X> UnsafeUnpin for StackEntry<X>
impl<X> UnwindSafe for StackEntry<X>
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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.