From c6e4284f8b786a700ca1a377c708a032240d34c8 Mon Sep 17 00:00:00 2001 From: Jack Huey Date: Sat, 15 May 2021 23:36:10 -0400 Subject: [PATCH] Add comments to opportunistic resolve functions --- compiler/rustc_infer/src/infer/region_constraints/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs index 69a33d46052e..493591301626 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs @@ -623,10 +623,14 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> { } } + /// Resolves the passed RegionVid to the root RegionVid in the unification table pub fn opportunistic_resolve_var(&mut self, rid: ty::RegionVid) -> ty::RegionVid { self.unification_table().find(rid).vid } + /// If the Region is a `ReVar`, then resolves it either to the root value in + /// the unification table, if it exists, or to the root `ReVar` in the table. + /// If the Region is not a `ReVar`, just returns the Region itself. pub fn opportunistic_resolve_region( &mut self, tcx: TyCtxt<'tcx>,