@@ -795,7 +795,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
795795
796796 // If the member region lives in a higher universe, we currently choose
797797 // the most conservative option by leaving it unchanged.
798-
799798 if !self . constraint_sccs ( ) . annotation ( scc) . min_universe ( ) . is_root ( ) {
800799 return ;
801800 }
@@ -823,12 +822,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
823822 }
824823 debug ! ( ?choice_regions, "after ub" ) ;
825824
826- // At this point we can pick any member of `choice_regions`, but to avoid potential
827- // non-determinism we will pick the *unique minimum* choice.
825+ // At this point we can pick any member of `choice_regions` and would like to choose
826+ // it to be a small as possible. To avoid potential non-determinism we will pick the
827+ // smallest such choice.
828828 //
829829 // Because universal regions are only partially ordered (i.e, not every two regions are
830830 // comparable), we will ignore any region that doesn't compare to all others when picking
831831 // the minimum choice.
832+ //
832833 // For example, consider `choice_regions = ['static, 'a, 'b, 'c, 'd, 'e]`, where
833834 // `'static: 'a, 'static: 'b, 'a: 'c, 'b: 'c, 'c: 'd, 'c: 'e`.
834835 // `['d, 'e]` are ignored because they do not compare - the same goes for `['a, 'b]`.
@@ -853,6 +854,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
853854 return ;
854855 } ;
855856
857+ // As we require `'scc: 'min_choice`, we have definitely already computed
858+ // its `scc_values` at this point.
856859 let min_choice_scc = self . constraint_sccs . scc ( min_choice) ;
857860 debug ! ( ?min_choice, ?min_choice_scc) ;
858861 if self . scc_values . add_region ( scc, min_choice_scc) {
0 commit comments