Struct rustc_type_ir::search_graph::SearchGraph
source · pub struct SearchGraph<D: Delegate<Cx = X>, X: Cx = X> {
mode: SolverMode,
stack: IndexVec<StackDepth, StackEntry<X>>,
provisional_cache: HashMap<X::Input, ProvisionalCacheEntry<X>>,
_marker: PhantomData<D>,
}
Fields§
§mode: SolverMode
§stack: IndexVec<StackDepth, StackEntry<X>>
The stack of goals currently being computed.
An element is deeper in the stack if its index is lower.
provisional_cache: HashMap<X::Input, ProvisionalCacheEntry<X>>
§_marker: PhantomData<D>
Implementations§
source§impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
pub(super) fn check_invariants(&self)
source§impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
pub fn new(mode: SolverMode) -> SearchGraph<D>
pub fn solver_mode(&self) -> SolverMode
fn update_parent_goal( &mut self, reached_depth: StackDepth, encountered_overflow: bool, )
pub fn is_empty(&self) -> bool
fn stack_coinductive_from( cx: X, stack: &IndexVec<StackDepth, StackEntry<X>>, head: StackDepth, ) -> bool
fn tag_cycle_participants( stack: &mut IndexVec<StackDepth, StackEntry<X>>, usage_kind: Option<UsageKind>, head: StackDepth, )
fn clear_dependent_provisional_results( provisional_cache: &mut HashMap<X::Input, ProvisionalCacheEntry<X>>, head: StackDepth, )
sourcepub fn with_new_goal(
&mut self,
cx: X,
input: X::Input,
inspect: &mut D::ProofTreeBuilder,
prove_goal: impl FnMut(&mut Self, &mut D::ProofTreeBuilder) -> X::Result,
) -> X::Result
pub fn with_new_goal( &mut self, cx: X, input: X::Input, inspect: &mut D::ProofTreeBuilder, prove_goal: impl FnMut(&mut Self, &mut D::ProofTreeBuilder) -> X::Result, ) -> X::Result
Probably the most involved method of the whole solver.
Given some goal which is proven via the prove_goal
closure, this
handles caching, overflow, and coinductive cycles.
sourcefn lookup_global_cache(
&mut self,
cx: X,
input: X::Input,
available_depth: AvailableDepth,
inspect: &mut D::ProofTreeBuilder,
) -> Option<X::Result>
fn lookup_global_cache( &mut self, cx: X, input: X::Input, available_depth: AvailableDepth, inspect: &mut D::ProofTreeBuilder, ) -> Option<X::Result>
Try to fetch a previously computed result from the global cache, making sure to only do so if it would match the result of reevaluating this goal.
source§impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
impl<D: Delegate<Cx = X>, X: Cx> SearchGraph<D>
sourcefn fixpoint_step_in_task<F>(
&mut self,
cx: X,
input: X::Input,
inspect: &mut D::ProofTreeBuilder,
prove_goal: &mut F,
) -> StepResult<X>
fn fixpoint_step_in_task<F>( &mut self, cx: X, input: X::Input, inspect: &mut D::ProofTreeBuilder, prove_goal: &mut F, ) -> StepResult<X>
When we encounter a coinductive cycle, we have to fetch the result of that cycle while we are still computing it. Because of this we continuously recompute the cycle until the result of the previous iteration is equal to the final result, at which point we are done.
Auto Trait Implementations§
impl<D, X> DynSend for SearchGraph<D, X>
impl<D, X> DynSync for SearchGraph<D, X>
impl<D, X> Freeze for SearchGraph<D, X>
impl<D, X> RefUnwindSafe for SearchGraph<D, X>
impl<D, X> Send for SearchGraph<D, X>
impl<D, X> Sync for SearchGraph<D, X>
impl<D, X> Unpin for SearchGraph<D, X>
impl<D, X> UnwindSafe for SearchGraph<D, 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: 64 bytes