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:
commit
e5e116dca9
11 changed files with 14 additions and 36 deletions
|
@ -156,10 +156,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
/// As the new solver does canonicalization slightly differently, this is also used there
|
||||
/// for now. This should hopefully change fairly soon.
|
||||
pub fn take_opaque_types_for_query_response(&self) -> Vec<(Ty<'tcx>, Ty<'tcx>)> {
|
||||
self.inner
|
||||
.borrow_mut()
|
||||
.opaque_type_storage
|
||||
.take_opaque_types()
|
||||
std::mem::take(&mut self.inner.borrow_mut().opaque_type_storage.opaque_types)
|
||||
.into_iter()
|
||||
.map(|(k, v)| (self.tcx.mk_opaque(k.def_id.to_def_id(), k.substs), v.hidden_type.ty))
|
||||
.collect()
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -29,11 +29,6 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", ret)]
|
||||
pub fn take_opaque_types(&mut self) -> OpaqueTypeMap<'tcx> {
|
||||
std::mem::take(&mut self.opaque_types)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn with_log<'a>(
|
||||
&'a mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue