]> git.lizzy.rs Git - rust.git/commitdiff
Add comments to opportunistic resolve functions
authorJack Huey <jack.huey@umassmed.edu>
Sun, 16 May 2021 03:36:10 +0000 (23:36 -0400)
committerJack Huey <jack.huey@umassmed.edu>
Sun, 16 May 2021 03:36:10 +0000 (23:36 -0400)
compiler/rustc_infer/src/infer/region_constraints/mod.rs

index 69a33d46052ed4963653a89793947ad3b05dc216..4935913016262bbabe29e320bba3c5072e77747b 100644 (file)
@@ -623,10 +623,14 @@ pub fn glb_regions(
         }
     }
 
+    /// 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>,