Skip to main content

SolverDelegate

Trait SolverDelegate 

Source
pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
    type Infcx: InferCtxtLike<Interner = Self::Interner>;
    type Interner: Interner;

Show 15 methods // Required methods fn build_with_canonical<V>( cx: Self::Interner, canonical: &CanonicalQueryInput<Self::Interner, V>, ) -> (Self, V, CanonicalVarValues<Self::Interner>) where V: TypeFoldable<Self::Interner>; fn compute_goal_fast_path( &self, goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>, span: <Self::Interner as Interner>::Span, ) -> ComputeGoalFastPathOutcome<Self::Interner>; fn fresh_var_for_kind( &self, arg: <Self::Interner as Interner>::GenericArg, span: <Self::Interner as Interner>::Span, universe: UniverseIndex, ) -> <Self::Interner as Interner>::GenericArg; fn leak_check( &self, max_input_universe: UniverseIndex, ) -> Result<(), NoSolution>; fn evaluate_const<E: Debug>( &self, param_env: <Self::Interner as Interner>::ParamEnv, alias_const: AliasConst<Self::Interner>, normalize_ty: impl FnOnce(Unnormalized<Self::Interner, <Self::Interner as Interner>::Ty>) -> Result<<Self::Interner as Interner>::Ty, E>, ) -> Result<Option<<Self::Interner as Interner>::Const>, E>; fn well_formed_goals( &self, param_env: <Self::Interner as Interner>::ParamEnv, term: <Self::Interner as Interner>::Term, ) -> Option<Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>>; fn make_deduplicated_region_constraints( &self, ) -> Vec<(RegionConstraint<Self::Interner>, VisibleForLeakCheck)>; fn instantiate_canonical<V>( &self, canonical: Canonical<Self::Interner, V>, values: CanonicalVarValues<Self::Interner>, ) -> V where V: TypeFoldable<Self::Interner>; fn instantiate_canonical_var( &self, kind: CanonicalVarKind<Self::Interner>, span: <Self::Interner as Interner>::Span, var_values: &[<Self::Interner as Interner>::GenericArg], universe_map: impl Fn(UniverseIndex) -> UniverseIndex, ) -> <Self::Interner as Interner>::GenericArg; fn add_item_bounds_for_hidden_type( &self, def_id: <Self::Interner as Interner>::OpaqueTyId, args: <Self::Interner as Interner>::GenericArgs, param_env: <Self::Interner as Interner>::ParamEnv, hidden_ty: <Self::Interner as Interner>::Ty, goals: &mut Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>, ); fn fetch_eligible_assoc_item( &self, goal_trait_ref: TraitRef<Self::Interner>, trait_assoc_def_id: <Self::Interner as Interner>::TraitAssocTermId, impl_def_id: <Self::Interner as Interner>::ImplId, ) -> FetchEligibleAssocItemResponse<Self::Interner>; fn is_transmutable( &self, src: <Self::Interner as Interner>::Ty, dst: <Self::Interner as Interner>::Ty, assume: <Self::Interner as Interner>::Const, ) -> Result<Certainty, NoSolution>; // Provided methods fn cx(&self) -> Self::Interner { ... } fn obtain_canonicalizer_state(&self) -> CanonicalizerState<Self::Interner> { ... } fn release_canonicalizer_state(&self, _: CanonicalizerState<Self::Interner>) { ... }
}

Required Associated Types§

Required Methods§

Source

fn build_with_canonical<V>( cx: Self::Interner, canonical: &CanonicalQueryInput<Self::Interner, V>, ) -> (Self, V, CanonicalVarValues<Self::Interner>)
where V: TypeFoldable<Self::Interner>,

Source

fn compute_goal_fast_path( &self, goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>, span: <Self::Interner as Interner>::Span, ) -> ComputeGoalFastPathOutcome<Self::Interner>

Source

fn fresh_var_for_kind( &self, arg: <Self::Interner as Interner>::GenericArg, span: <Self::Interner as Interner>::Span, universe: UniverseIndex, ) -> <Self::Interner as Interner>::GenericArg

Source

fn leak_check( &self, max_input_universe: UniverseIndex, ) -> Result<(), NoSolution>

Source

fn evaluate_const<E: Debug>( &self, param_env: <Self::Interner as Interner>::ParamEnv, alias_const: AliasConst<Self::Interner>, normalize_ty: impl FnOnce(Unnormalized<Self::Interner, <Self::Interner as Interner>::Ty>) -> Result<<Self::Interner as Interner>::Ty, E>, ) -> Result<Option<<Self::Interner as Interner>::Const>, E>

Evaluate a const, normalizing the type of the resulting value with normalize_ty. Returns Ok(None) if the const is too generic, and Err(_) only if normalize_ty failed.

Source

fn well_formed_goals( &self, param_env: <Self::Interner as Interner>::ParamEnv, term: <Self::Interner as Interner>::Term, ) -> Option<Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>>

Source

fn make_deduplicated_region_constraints( &self, ) -> Vec<(RegionConstraint<Self::Interner>, VisibleForLeakCheck)>

Source

fn instantiate_canonical<V>( &self, canonical: Canonical<Self::Interner, V>, values: CanonicalVarValues<Self::Interner>, ) -> V
where V: TypeFoldable<Self::Interner>,

Source

fn instantiate_canonical_var( &self, kind: CanonicalVarKind<Self::Interner>, span: <Self::Interner as Interner>::Span, var_values: &[<Self::Interner as Interner>::GenericArg], universe_map: impl Fn(UniverseIndex) -> UniverseIndex, ) -> <Self::Interner as Interner>::GenericArg

Source

fn add_item_bounds_for_hidden_type( &self, def_id: <Self::Interner as Interner>::OpaqueTyId, args: <Self::Interner as Interner>::GenericArgs, param_env: <Self::Interner as Interner>::ParamEnv, hidden_ty: <Self::Interner as Interner>::Ty, goals: &mut Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>, )

Source

fn fetch_eligible_assoc_item( &self, goal_trait_ref: TraitRef<Self::Interner>, trait_assoc_def_id: <Self::Interner as Interner>::TraitAssocTermId, impl_def_id: <Self::Interner as Interner>::ImplId, ) -> FetchEligibleAssocItemResponse<Self::Interner>

Source

fn is_transmutable( &self, src: <Self::Interner as Interner>::Ty, dst: <Self::Interner as Interner>::Ty, assume: <Self::Interner as Interner>::Const, ) -> Result<Certainty, NoSolution>

Provided Methods§

Source

fn cx(&self) -> Self::Interner

Source

fn obtain_canonicalizer_state(&self) -> CanonicalizerState<Self::Interner>

Obtain canonicalizer state, either by allocating it afresh (the default) or by reusing previously allocated state.

Source

fn release_canonicalizer_state(&self, _: CanonicalizerState<Self::Interner>)

Release canonicalizer state, either by deallocating it (the default) or by clearing it and stashing it for later reuse.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§