Skip to content

Commit c6e4284

Browse files
committed
Add comments to opportunistic resolve functions
1 parent 909d0e8 commit c6e4284

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_infer/src/infer/region_constraints

1 file changed

+4
-0
lines changed

compiler/rustc_infer/src/infer/region_constraints/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,14 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
623623
}
624624
}
625625

626+
/// Resolves the passed RegionVid to the root RegionVid in the unification table
626627
pub fn opportunistic_resolve_var(&mut self, rid: ty::RegionVid) -> ty::RegionVid {
627628
self.unification_table().find(rid).vid
628629
}
629630

631+
/// If the Region is a `ReVar`, then resolves it either to the root value in
632+
/// the unification table, if it exists, or to the root `ReVar` in the table.
633+
/// If the Region is not a `ReVar`, just returns the Region itself.
630634
pub fn opportunistic_resolve_region(
631635
&mut self,
632636
tcx: TyCtxt<'tcx>,

0 commit comments

Comments
 (0)