Rollup merge of #139191 - lcnr:interner-opaques, r=compiler-errors

small opaque type/borrowck cleanup

pulled out of #138785
This commit is contained in:
Stuart Cook 2025-04-02 13:10:40 +11:00 committed by GitHub
commit 2311b342bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 35 additions and 61 deletions

View file

@ -149,16 +149,16 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
self.0.instantiate_canonical_var(span, cv_info, universe_map)
}
fn insert_hidden_type(
fn register_hidden_type_in_storage(
&self,
opaque_type_key: ty::OpaqueTypeKey<'tcx>,
param_env: ty::ParamEnv<'tcx>,
hidden_ty: Ty<'tcx>,
goals: &mut Vec<Goal<'tcx, ty::Predicate<'tcx>>>,
) -> Result<(), NoSolution> {
self.0
.insert_hidden_type(opaque_type_key, DUMMY_SP, param_env, hidden_ty, goals)
.map_err(|_| NoSolution)
opaque_type_key: rustc_type_ir::OpaqueTypeKey<Self::Interner>,
hidden_ty: <Self::Interner as ty::Interner>::Ty,
span: <Self::Interner as ty::Interner>::Span,
) -> Option<<Self::Interner as ty::Interner>::Ty> {
self.0.register_hidden_type_in_storage(
opaque_type_key,
ty::OpaqueHiddenType { span, ty: hidden_ty },
)
}
fn add_item_bounds_for_hidden_type(
@ -172,15 +172,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 inject_new_hidden_type_unchecked(
&self,
key: ty::OpaqueTypeKey<'tcx>,
hidden_ty: Ty<'tcx>,
span: Span,
) {
self.0.inject_new_hidden_type_unchecked(key, ty::OpaqueHiddenType { ty: hidden_ty, span })
}
fn reset_opaque_types(&self) {
let _ = self.take_opaque_types();
}