Get rid of trait_ref_is_knowable from delegate
This commit is contained in:
parent
a982471e07
commit
ab27c2fa77
4 changed files with 4 additions and 21 deletions
|
@ -1,4 +1,3 @@
|
|||
use std::fmt::Debug;
|
||||
use std::ops::Deref;
|
||||
|
||||
use rustc_type_ir::fold::TypeFoldable;
|
||||
|
@ -99,14 +98,6 @@ pub trait SolverDelegate:
|
|||
|
||||
fn reset_opaque_types(&self);
|
||||
|
||||
fn trait_ref_is_knowable<E: Debug>(
|
||||
&self,
|
||||
trait_ref: ty::TraitRef<Self::Interner>,
|
||||
lazily_normalize_ty: impl FnMut(
|
||||
<Self::Interner as Interner>::Ty,
|
||||
) -> Result<<Self::Interner as Interner>::Ty, E>,
|
||||
) -> Result<bool, E>;
|
||||
|
||||
fn fetch_eligible_assoc_item(
|
||||
&self,
|
||||
param_env: <Self::Interner as Interner>::ParamEnv,
|
||||
|
|
|
@ -11,6 +11,7 @@ use rustc_type_ir::{self as ty, CanonicalVarValues, InferCtxtLike, Interner};
|
|||
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
|
||||
use tracing::{instrument, trace};
|
||||
|
||||
use crate::coherence;
|
||||
use crate::delegate::SolverDelegate;
|
||||
use crate::solve::inspect::{self, ProofTreeBuilder};
|
||||
use crate::solve::search_graph::SearchGraph;
|
||||
|
@ -906,7 +907,8 @@ where
|
|||
) -> Result<bool, NoSolution> {
|
||||
let delegate = self.delegate;
|
||||
let lazily_normalize_ty = |ty| self.structurally_normalize_ty(param_env, ty);
|
||||
delegate.trait_ref_is_knowable(trait_ref, lazily_normalize_ty)
|
||||
coherence::trait_ref_is_knowable(&**delegate, trait_ref, lazily_normalize_ty)
|
||||
.map(|is_knowable| is_knowable.is_ok())
|
||||
}
|
||||
|
||||
pub(super) fn fetch_eligible_assoc_item(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue