diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs
index 46420fbe0c3..38b092cfd70 100644
--- a/compiler/rustc_infer/src/infer/opaque_types.rs
+++ b/compiler/rustc_infer/src/infer/opaque_types.rs
@@ -163,7 +163,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
                     Ok(_) => span_bug!(
                         cause.span,
                         "opaque types are never equal to anything but themselves: {:#?}",
-                        (a, b)
+                        (a.kind(), b.kind())
                     ),
                     Err(e) => Err(e),
                 }
@@ -450,10 +450,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
         trace!(?origin);
         origin
     }
-
-    pub fn opaque_types(&self) -> OpaqueTypeMap<'tcx> {
-        self.inner.borrow().opaque_type_storage.opaque_types()
-    }
 }
 
 // Visitor that requires that (almost) all regions in the type visited outlive
diff --git a/compiler/rustc_infer/src/infer/opaque_types/table.rs b/compiler/rustc_infer/src/infer/opaque_types/table.rs
index 202afea559c..55da42e98f4 100644
--- a/compiler/rustc_infer/src/infer/opaque_types/table.rs
+++ b/compiler/rustc_infer/src/infer/opaque_types/table.rs
@@ -29,14 +29,6 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
         }
     }
 
-    pub fn get_decl(&self, key: &OpaqueTypeKey<'tcx>) -> Option<&OpaqueTypeDecl<'tcx>> {
-        self.opaque_types.get(key)
-    }
-
-    pub fn opaque_types(&self) -> OpaqueTypeMap<'tcx> {
-        self.opaque_types.clone()
-    }
-
     #[instrument(level = "debug")]
     pub fn take_opaque_types(&mut self) -> OpaqueTypeMap<'tcx> {
         std::mem::take(&mut self.opaque_types)
@@ -69,7 +61,7 @@ pub struct OpaqueTypeTable<'a, 'tcx> {
 
 impl<'a, 'tcx> OpaqueTypeTable<'a, 'tcx> {
     #[instrument(skip(self), level = "debug")]
-    pub fn register(
+    pub(crate) fn register(
         &mut self,
         key: OpaqueTypeKey<'tcx>,
         hidden_type: OpaqueHiddenType<'tcx>,