struct NestedGoals<X: Cx> {
nested_goals: HashMap<X::Input, UsageKind>,
}
Expand description
The nested goals of each stack entry and the path from the stack entry to that nested goal.
We only start tracking nested goals once we’ve either encountered overflow or a solver cycle. This is a performance optimization to avoid tracking nested goals on the happy path.
We use nested goals for two reasons:
- when rebasing provisional cache entries
- when checking whether we have to ignore a global cache entry as reevaluating it would encounter a cycle or use a provisional cache entry.
We need to disable the global cache if using it would hide a cycle, as cycles can impact behavior. The cycle ABA may have different final results from a the cycle BAB depending on the cycle root.
Fields§
§nested_goals: HashMap<X::Input, UsageKind>
Implementations§
source§impl<X: Cx> NestedGoals<X>
impl<X: Cx> NestedGoals<X>
fn is_empty(&self) -> bool
fn insert(&mut self, input: X::Input, path_from_entry: UsageKind)
fn merge(&mut self, nested_goals: &NestedGoals<X>)
sourcefn extend_from_child(
&mut self,
step_kind: PathKind,
nested_goals: &NestedGoals<X>,
)
fn extend_from_child( &mut self, step_kind: PathKind, nested_goals: &NestedGoals<X>, )
Adds the nested goals of a nested goal, given that the path step_kind
from this goal
to the parent goal.
If the path from this goal to the nested goal is inductive, the paths from this goal to all nested goals of that nested goal are also inductive. Otherwise the paths are the same as for the child.
fn iter(&self) -> impl Iterator<Item = (X::Input, UsageKind)> + '_
fn get(&self, input: X::Input) -> Option<UsageKind>
fn contains(&self, input: X::Input) -> bool
Trait Implementations§
source§impl<X> Debug for NestedGoals<X>where
X: Cx,
impl<X> Debug for NestedGoals<X>where
X: Cx,
Auto Trait Implementations§
impl<X> DynSend for NestedGoals<X>
impl<X> DynSync for NestedGoals<X>
impl<X> Freeze for NestedGoals<X>
impl<X> RefUnwindSafe for NestedGoals<X>
impl<X> Send for NestedGoals<X>
impl<X> Sync for NestedGoals<X>
impl<X> Unpin for NestedGoals<X>
impl<X> UnwindSafe for NestedGoals<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
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<'a, T> Captures<'a> for Twhere
T: ?Sized,
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: 32 bytes