1
Fork 0

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

@ -198,13 +198,12 @@ impl<'tcx> InferCtxt<'tcx> {
/// it hasn't previously been defined. This does not emit any
/// constraints and it's the responsibility of the caller to make
/// sure that the item bounds of the opaque are checked.
pub fn inject_new_hidden_type_unchecked(
pub fn register_hidden_type_in_storage(
&self,
opaque_type_key: OpaqueTypeKey<'tcx>,
hidden_ty: OpaqueHiddenType<'tcx>,
) {
let prev = self.inner.borrow_mut().opaque_types().register(opaque_type_key, hidden_ty);
assert_eq!(prev, None);
) -> Option<Ty<'tcx>> {
self.inner.borrow_mut().opaque_types().register(opaque_type_key, hidden_ty)
}
/// Insert a hidden type into the opaque type storage, equating it