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