opaque_type_storage to InferCtxtLike

This commit is contained in:
lcnr
2025-05-04 17:35:39 +00:00
parent 3ef8e64ce9
commit fc0ef54fd9
4 changed files with 61 additions and 69 deletions

View File

@@ -104,25 +104,6 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
.map(|obligations| obligations.into_iter().map(|obligation| obligation.as_goal()).collect())
}
fn clone_opaque_types_lookup_table(&self) -> Vec<(ty::OpaqueTypeKey<'tcx>, Ty<'tcx>)> {
self.0
.inner
.borrow_mut()
.opaque_types()
.iter_lookup_table()
.map(|(k, h)| (k, h.ty))
.collect()
}
fn clone_duplicate_opaque_types(&self) -> Vec<(ty::OpaqueTypeKey<'tcx>, Ty<'tcx>)> {
self.0
.inner
.borrow_mut()
.opaque_types()
.iter_duplicate_entries()
.map(|(k, h)| (k, h.ty))
.collect()
}
fn make_deduplicated_outlives_constraints(
&self,
) -> Vec<ty::OutlivesPredicate<'tcx, ty::GenericArg<'tcx>>> {
@@ -168,30 +149,6 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
self.0.instantiate_canonical_var(span, cv_info, universe_map)
}
fn register_hidden_type_in_storage(
&self,
opaque_type_key: ty::OpaqueTypeKey<'tcx>,
hidden_ty: Ty<'tcx>,
span: Span,
) -> Option<Ty<'tcx>> {
self.0.register_hidden_type_in_storage(
opaque_type_key,
ty::OpaqueHiddenType { span, ty: hidden_ty },
)
}
fn add_duplicate_opaque_type(
&self,
opaque_type_key: ty::OpaqueTypeKey<'tcx>,
hidden_ty: Ty<'tcx>,
span: Span,
) {
self.0
.inner
.borrow_mut()
.opaque_types()
.add_duplicate(opaque_type_key, ty::OpaqueHiddenType { span, ty: hidden_ty })
}
fn add_item_bounds_for_hidden_type(
&self,
def_id: DefId,
@@ -203,10 +160,6 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
self.0.add_item_bounds_for_hidden_type(def_id, args, param_env, hidden_ty, goals);
}
fn reset_opaque_types(&self) {
let _ = self.take_opaque_types();
}
fn fetch_eligible_assoc_item(
&self,
goal_trait_ref: ty::TraitRef<'tcx>,