diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-04 12:58:20 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-10 06:07:51 -0400 |
| commit | efb1c23ff602485531d65d31ed014d4575a12cec (patch) | |
| tree | aeb11bfa38ce2311cf748c43c056b1ee14be30b9 /compiler/rustc_infer | |
| parent | ce7a61b9d0bb4b7bb99ade4bff2449fabc9afd3f (diff) | |
| download | rust-efb1c23ff602485531d65d31ed014d4575a12cec.tar.gz rust-efb1c23ff602485531d65d31ed014d4575a12cec.zip | |
Introduce SolverRelating
Diffstat (limited to 'compiler/rustc_infer')
| -rw-r--r-- | compiler/rustc_infer/src/infer/context.rs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/compiler/rustc_infer/src/infer/context.rs b/compiler/rustc_infer/src/infer/context.rs index 10b22c98a0d..497be6b5404 100644 --- a/compiler/rustc_infer/src/infer/context.rs +++ b/compiler/rustc_infer/src/infer/context.rs @@ -136,6 +136,10 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> { self.enter_forall(value, f) } + fn equate_ty_vids_raw(&self, a: rustc_type_ir::TyVid, b: rustc_type_ir::TyVid) { + self.inner.borrow_mut().type_variables().equate(a, b); + } + fn equate_int_vids_raw(&self, a: rustc_type_ir::IntVid, b: rustc_type_ir::IntVid) { self.inner.borrow_mut().int_unification_table().union(a, b); } @@ -152,6 +156,23 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> { self.inner.borrow_mut().effect_unification_table().union(a, b); } + fn instantiate_ty_var_raw<R: PredicateEmittingRelation<Self>>( + &self, + relation: &mut R, + target_is_expected: bool, + target_vid: rustc_type_ir::TyVid, + instantiation_variance: rustc_type_ir::Variance, + source_ty: Ty<'tcx>, + ) -> RelateResult<'tcx, ()> { + self.instantiate_ty_var( + relation, + target_is_expected, + target_vid, + instantiation_variance, + source_ty, + ) + } + fn instantiate_int_var_raw( &self, vid: rustc_type_ir::IntVid, @@ -228,7 +249,19 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> { } fn sub_regions(&self, sub: ty::Region<'tcx>, sup: ty::Region<'tcx>) { - self.sub_regions(SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None), sub, sup) + self.inner.borrow_mut().unwrap_region_constraints().make_subregion( + SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None), + sub, + sup, + ); + } + + fn equate_regions(&self, a: ty::Region<'tcx>, b: ty::Region<'tcx>) { + self.inner.borrow_mut().unwrap_region_constraints().make_eqregion( + SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None), + a, + b, + ); } fn register_ty_outlives(&self, ty: Ty<'tcx>, r: ty::Region<'tcx>) { |
