Skip to content

Commit b0639e9

Browse files
committed
Avoid giving an inferctxt a defining use anchor
1 parent f928076 commit b0639e9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

compiler/rustc_const_eval/src/util/compare_types.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! FIXME: Move this to a more general place. The utility of this extends to
44
//! other areas of the compiler as well.
55
6-
use rustc_infer::infer::{DefiningAnchor, TyCtxtInferExt};
6+
use rustc_infer::infer::TyCtxtInferExt;
77
use rustc_infer::traits::ObligationCause;
88
use rustc_middle::ty::{ParamEnv, Ty, TyCtxt};
99
use rustc_trait_selection::traits::ObligationCtxt;
@@ -41,8 +41,7 @@ pub fn is_subtype<'tcx>(
4141
return true;
4242
}
4343

44-
let mut builder =
45-
tcx.infer_ctxt().ignoring_regions().with_opaque_type_inference(DefiningAnchor::Bubble);
44+
let mut builder = tcx.infer_ctxt().ignoring_regions();
4645
let infcx = builder.build();
4746
let ocx = ObligationCtxt::new_with_opaque_type_bubbling(&infcx);
4847
let cause = ObligationCause::dummy();

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,6 @@ impl<'tcx> InferCtxt<'tcx> {
13181318

13191319
#[instrument(level = "debug", skip(self), ret)]
13201320
pub fn take_opaque_types(&self) -> opaque_types::OpaqueTypeMap<'tcx> {
1321-
debug_assert_ne!(self.old_defining_use_anchor, DefiningAnchor::Error);
13221321
std::mem::take(&mut self.inner.borrow_mut().opaque_type_storage.opaque_types)
13231322
}
13241323

0 commit comments

Comments
 (0)