simplify Interner opaque types API

This commit is contained in:
lcnr
2025-03-31 21:45:34 +02:00
parent 5f74fa02af
commit cb275d4f26
7 changed files with 26 additions and 47 deletions

View File

@@ -62,14 +62,12 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
universe_map: impl Fn(ty::UniverseIndex) -> ty::UniverseIndex,
) -> <Self::Interner as Interner>::GenericArg;
// FIXME: Can we implement this in terms of `add` and `inject`?
fn insert_hidden_type(
fn register_hidden_type_in_storage(
&self,
opaque_type_key: ty::OpaqueTypeKey<Self::Interner>,
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>>,
) -> Result<(), NoSolution>;
span: <Self::Interner as Interner>::Span,
) -> Option<<Self::Interner as Interner>::Ty>;
fn add_item_bounds_for_hidden_type(
&self,
@@ -79,14 +77,6 @@ pub trait SolverDelegate: Deref<Target = Self::Infcx> + Sized {
hidden_ty: <Self::Interner as Interner>::Ty,
goals: &mut Vec<Goal<Self::Interner, <Self::Interner as Interner>::Predicate>>,
);
fn inject_new_hidden_type_unchecked(
&self,
key: ty::OpaqueTypeKey<Self::Interner>,
hidden_ty: <Self::Interner as Interner>::Ty,
span: <Self::Interner as Interner>::Span,
);
fn reset_opaque_types(&self);
fn fetch_eligible_assoc_item(