Skip to content

Commit 5cb2d9d

Browse files
committed
woops
1 parent 9b3630f commit 5cb2d9d

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
@@ -2548,30 +2548,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25482548
)
25492549
.apply_closure_requirements(closure_requirements, def_id.to_def_id(), args);
25502550

2551-
for (opaque_type_key, hidden_ty) in opaque_types {
2551+
for (OpaqueTypeKey { def_id, args }, hidden_ty) in opaque_types {
25522552
let _: Result<_, ErrorGuaranteed> = self.fully_perform_op(
25532553
Locations::All(hidden_ty.span),
25542554
ConstraintCategory::OpaqueType,
25552555
CustomTypeOp::new(
25562556
|ocx| {
2557-
let mut goals = Vec::new();
2558-
ocx.infcx.insert_hidden_type(
2559-
opaque_type_key,
2560-
hidden_ty.span,
2561-
self.infcx.param_env,
2562-
hidden_ty.ty,
2563-
&mut goals,
2564-
)?;
2565-
2566-
ocx.register_obligations(goals.into_iter().map(|goal| {
2567-
Obligation::new(
2568-
tcx,
2569-
ObligationCause::dummy_with_span(hidden_ty.span),
2570-
goal.param_env,
2571-
goal.predicate,
2572-
)
2573-
}));
2574-
Ok(())
2557+
let cause = ObligationCause::dummy_with_span(hidden_ty.span);
2558+
let alias = ty::AliasTy::new(tcx, def_id.to_def_id(), args).to_ty(tcx);
2559+
ocx.eq(&cause, self.infcx.param_env, alias, hidden_ty.ty)
2560+
.map_err(|_e| NoSolution)
25752561
},
25762562
"opaque_type_map",
25772563
),

0 commit comments

Comments
 (0)