about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJack Huey <jack.huey@umassmed.edu>2021-05-15 23:36:10 -0400
committerJack Huey <jack.huey@umassmed.edu>2021-05-15 23:36:10 -0400
commitc6e4284f8b786a700ca1a377c708a032240d34c8 (patch)
treee26e0dc4e3a55c2627f2cea9b6478ffc6a35ec52
parent909d0e83d626151f54461e3819d31166b796b805 (diff)
downloadrust-c6e4284f8b786a700ca1a377c708a032240d34c8.tar.gz
rust-c6e4284f8b786a700ca1a377c708a032240d34c8.zip
Add comments to opportunistic resolve functions
-rw-r--r--compiler/rustc_infer/src/infer/region_constraints/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs
index 69a33d46052..49359130162 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>,