@@ -737,18 +737,6 @@ trait InferCtxtExt<'tcx> {
737
737
) -> T
738
738
where
739
739
T : TypeFoldable < TyCtxt < ' tcx > > ;
740
-
741
- fn instantiate_bound_regions_with_nll_infer_vars_in_recursive_scope (
742
- & self ,
743
- mir_def_id : LocalDefId ,
744
- indices : & mut UniversalRegionIndices < ' tcx > ,
745
- ) ;
746
-
747
- fn instantiate_bound_regions_with_nll_infer_vars_in_item (
748
- & self ,
749
- mir_def_id : LocalDefId ,
750
- indices : & mut UniversalRegionIndices < ' tcx > ,
751
- ) ;
752
740
}
753
741
754
742
impl < ' cx , ' tcx > InferCtxtExt < ' tcx > for BorrowckInferCtxt < ' cx , ' tcx > {
@@ -799,54 +787,6 @@ impl<'cx, 'tcx> InferCtxtExt<'tcx> for BorrowckInferCtxt<'cx, 'tcx> {
799
787
} ) ;
800
788
value
801
789
}
802
-
803
- /// Finds late-bound regions that do not appear in the parameter listing and adds them to the
804
- /// indices vector. Typically, we identify late-bound regions as we process the inputs and
805
- /// outputs of the closure/function. However, sometimes there are late-bound regions which do
806
- /// not appear in the fn parameters but which are nonetheless in scope. The simplest case of
807
- /// this are unused functions, like fn foo<'a>() { } (see e.g., #51351). Despite not being used,
808
- /// users can still reference these regions (e.g., let x: &'a u32 = &22;), so we need to create
809
- /// entries for them and store them in the indices map. This code iterates over the complete
810
- /// set of late-bound regions and checks for any that we have not yet seen, adding them to the
811
- /// inputs vector.
812
- #[ instrument( skip( self , indices) ) ]
813
- fn instantiate_bound_regions_with_nll_infer_vars_in_recursive_scope (
814
- & self ,
815
- mir_def_id : LocalDefId ,
816
- indices : & mut UniversalRegionIndices < ' tcx > ,
817
- ) {
818
- for_each_late_bound_region_in_recursive_scope ( self . tcx , mir_def_id, |r| {
819
- debug ! ( ?r) ;
820
- if !indices. indices . contains_key ( & r) {
821
- let region_vid = {
822
- let name = r. get_name_or_anon ( ) ;
823
- self . next_nll_region_var ( FR , || RegionCtxt :: LateBound ( name) )
824
- } ;
825
-
826
- debug ! ( ?region_vid) ;
827
- indices. insert_late_bound_region ( r, region_vid. as_var ( ) ) ;
828
- }
829
- } ) ;
830
- }
831
-
832
- #[ instrument( skip( self , indices) ) ]
833
- fn instantiate_bound_regions_with_nll_infer_vars_in_item (
834
- & self ,
835
- mir_def_id : LocalDefId ,
836
- indices : & mut UniversalRegionIndices < ' tcx > ,
837
- ) {
838
- for_each_late_bound_region_in_item ( self . tcx , mir_def_id, |r| {
839
- debug ! ( ?r) ;
840
- if !indices. indices . contains_key ( & r) {
841
- let region_vid = {
842
- let name = r. get_name_or_anon ( ) ;
843
- self . next_nll_region_var ( FR , || RegionCtxt :: LateBound ( name) )
844
- } ;
845
-
846
- indices. insert_late_bound_region ( r, region_vid. as_var ( ) ) ;
847
- }
848
- } ) ;
849
- }
850
790
}
851
791
852
792
impl < ' tcx > UniversalRegionIndices < ' tcx > {
0 commit comments