@@ -795,7 +795,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
795
795
796
796
// If the member region lives in a higher universe, we currently choose
797
797
// the most conservative option by leaving it unchanged.
798
-
799
798
if !self . constraint_sccs ( ) . annotation ( scc) . min_universe ( ) . is_root ( ) {
800
799
return ;
801
800
}
@@ -823,12 +822,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
823
822
}
824
823
debug ! ( ?choice_regions, "after ub" ) ;
825
824
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.
828
828
//
829
829
// Because universal regions are only partially ordered (i.e, not every two regions are
830
830
// comparable), we will ignore any region that doesn't compare to all others when picking
831
831
// the minimum choice.
832
+ //
832
833
// For example, consider `choice_regions = ['static, 'a, 'b, 'c, 'd, 'e]`, where
833
834
// `'static: 'a, 'static: 'b, 'a: 'c, 'b: 'c, 'c: 'd, 'c: 'e`.
834
835
// `['d, 'e]` are ignored because they do not compare - the same goes for `['a, 'b]`.
@@ -853,6 +854,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
853
854
return ;
854
855
} ;
855
856
857
+ // As we require `'scc: 'min_choice`, we have definitely already computed
858
+ // its `scc_values` at this point.
856
859
let min_choice_scc = self . constraint_sccs . scc ( min_choice) ;
857
860
debug ! ( ?min_choice, ?min_choice_scc) ;
858
861
if self . scc_values . add_region ( scc, min_choice_scc) {
0 commit comments