@@ -551,7 +551,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
551
551
polonius_output : Option < Rc < PoloniusOutput > > ,
552
552
) -> ( Option < ClosureRegionRequirements < ' tcx > > , RegionErrors < ' tcx > ) {
553
553
let mir_def_id = body. source . def_id ( ) ;
554
- self . propagate_constraints ( body, infcx . tcx ) ;
554
+ self . propagate_constraints ( body) ;
555
555
556
556
let mut errors_buffer = RegionErrors :: new ( ) ;
557
557
@@ -599,7 +599,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
599
599
/// for each region variable until all the constraints are
600
600
/// satisfied. Note that some values may grow **too** large to be
601
601
/// feasible, but we check this later.
602
- fn propagate_constraints ( & mut self , _body : & Body < ' tcx > , tcx : TyCtxt < ' tcx > ) {
602
+ fn propagate_constraints ( & mut self , _body : & Body < ' tcx > ) {
603
603
debug ! ( "propagate_constraints()" ) ;
604
604
605
605
debug ! ( "propagate_constraints: constraints={:#?}" , {
@@ -617,7 +617,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
617
617
// own.
618
618
let constraint_sccs = self . constraint_sccs . clone ( ) ;
619
619
for scc in constraint_sccs. all_sccs ( ) {
620
- self . compute_value_for_scc ( scc, tcx ) ;
620
+ self . compute_value_for_scc ( scc) ;
621
621
}
622
622
623
623
// Sort the applied member constraints so we can binary search
@@ -629,7 +629,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
629
629
/// computed, by unioning the values of its successors.
630
630
/// Assumes that all successors have been computed already
631
631
/// (which is assured by iterating over SCCs in dependency order).
632
- fn compute_value_for_scc ( & mut self , scc_a : ConstraintSccIndex , tcx : TyCtxt < ' tcx > ) {
632
+ fn compute_value_for_scc ( & mut self , scc_a : ConstraintSccIndex ) {
633
633
let constraint_sccs = self . constraint_sccs . clone ( ) ;
634
634
635
635
// Walk each SCC `B` such that `A: B`...
@@ -652,12 +652,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
652
652
// Now take member constraints into account.
653
653
let member_constraints = self . member_constraints . clone ( ) ;
654
654
for m_c_i in member_constraints. indices ( scc_a) {
655
- self . apply_member_constraint (
656
- tcx,
657
- scc_a,
658
- m_c_i,
659
- member_constraints. choice_regions ( m_c_i) ,
660
- ) ;
655
+ self . apply_member_constraint ( scc_a, m_c_i, member_constraints. choice_regions ( m_c_i) ) ;
661
656
}
662
657
663
658
debug ! (
@@ -680,31 +675,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
680
675
/// If we make any changes, returns true, else false.
681
676
fn apply_member_constraint (
682
677
& mut self ,
683
- tcx : TyCtxt < ' tcx > ,
684
678
scc : ConstraintSccIndex ,
685
679
member_constraint_index : NllMemberConstraintIndex ,
686
680
choice_regions : & [ ty:: RegionVid ] ,
687
681
) -> bool {
688
682
debug ! ( "apply_member_constraint(scc={:?}, choice_regions={:#?})" , scc, choice_regions, ) ;
689
683
690
- if let Some ( uh_oh) =
691
- choice_regions. iter ( ) . find ( |& & r| !self . universal_regions . is_universal_region ( r) )
692
- {
693
- // FIXME(#61773): This case can only occur with
694
- // `impl_trait_in_bindings`, I believe, and we are just
695
- // opting not to handle it for now. See #61773 for
696
- // details.
697
- tcx. sess . delay_span_bug (
698
- self . member_constraints [ member_constraint_index] . definition_span ,
699
- & format ! (
700
- "member constraint for `{:?}` has an option region `{:?}` \
701
- that is not a universal region",
702
- self . member_constraints[ member_constraint_index] . opaque_type_def_id, uh_oh,
703
- ) ,
704
- ) ;
705
- return false ;
706
- }
707
-
708
684
// Create a mutable vector of the options. We'll try to winnow
709
685
// them down.
710
686
let mut choice_regions: Vec < ty:: RegionVid > = choice_regions. to_vec ( ) ;
0 commit comments