Skip to content

Commit d40b6e1

Browse files
committed
woops
1 parent 3d6168a commit d40b6e1

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_hir::def::DefKind;
44
use rustc_infer::infer::canonical::QueryRegionConstraints;
55
use rustc_infer::infer::outlives::env::RegionBoundPairs;
66
use rustc_infer::infer::region_constraints::GenericKind;
7-
use rustc_infer::infer::{outlives, InferCtxt, NllRegionVariableOrigin};
7+
use rustc_infer::infer::{InferCtxt, NllRegionVariableOrigin, outlives};
88
use rustc_infer::traits::ScrubbedTraitError;
99
use rustc_middle::mir::ConstraintCategory;
1010
use rustc_middle::traits::ObligationCause;

compiler/rustc_borrowck/src/type_check/mod.rs

+5-19
Original file line numberDiff line numberDiff line change
@@ -2535,30 +2535,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25352535
)
25362536
.apply_closure_requirements(closure_requirements, def_id.to_def_id(), args);
25372537

2538-
for (opaque_type_key, hidden_ty) in opaque_types {
2538+
for (OpaqueTypeKey { def_id, args }, hidden_ty) in opaque_types {
25392539
let _: Result<_, ErrorGuaranteed> = self.fully_perform_op(
25402540
Locations::All(hidden_ty.span),
25412541
ConstraintCategory::OpaqueType,
25422542
CustomTypeOp::new(
25432543
|ocx| {
2544-
let mut goals = Vec::new();
2545-
ocx.infcx.insert_hidden_type(
2546-
opaque_type_key,
2547-
hidden_ty.span,
2548-
self.infcx.param_env,
2549-
hidden_ty.ty,
2550-
&mut goals,
2551-
)?;
2552-
2553-
ocx.register_obligations(goals.into_iter().map(|goal| {
2554-
Obligation::new(
2555-
tcx,
2556-
ObligationCause::dummy_with_span(hidden_ty.span),
2557-
goal.param_env,
2558-
goal.predicate,
2559-
)
2560-
}));
2561-
Ok(())
2544+
let cause = ObligationCause::dummy_with_span(hidden_ty.span);
2545+
let alias = ty::AliasTy::new(tcx, def_id.to_def_id(), args).to_ty(tcx);
2546+
ocx.eq(&cause, self.infcx.param_env, alias, hidden_ty.ty)
2547+
.map_err(|_e| NoSolution)
25622548
},
25632549
"opaque_type_map",
25642550
),

0 commit comments

Comments
 (0)