Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obk

No need to take opaques in `check_type_bounds`

`InferCtxt` already has its defining use anchor set to err

r? ``@oli-obk``
This commit is contained in:
Yuki Okushi
2023-01-10 08:05:34 +09:00
committed by GitHub
11 changed files with 14 additions and 36 deletions

View File

@@ -1338,6 +1338,12 @@ impl<'tcx> InferCtxt<'tcx> {
var_infos
}
#[instrument(level = "debug", skip(self), ret)]
pub fn take_opaque_types(&self) -> opaque_types::OpaqueTypeMap<'tcx> {
debug_assert_ne!(self.defining_use_anchor, DefiningAnchor::Error);
std::mem::take(&mut self.inner.borrow_mut().opaque_type_storage.opaque_types)
}
pub fn ty_to_string(&self, t: Ty<'tcx>) -> String {
self.resolve_vars_if_possible(t).to_string()
}