@@ -108,7 +108,6 @@ pub(crate) trait OutlivesEnvironmentExt<'tcx> {
108108 infcx : & InferCtxt < ' _ , ' tcx > ,
109109 fn_sig_tys : FxHashSet < Ty < ' tcx > > ,
110110 body_id : hir:: HirId ,
111- span : Span ,
112111 ) ;
113112}
114113
@@ -135,11 +134,10 @@ impl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx> {
135134 infcx : & InferCtxt < ' a , ' tcx > ,
136135 fn_sig_tys : FxHashSet < Ty < ' tcx > > ,
137136 body_id : hir:: HirId ,
138- span : Span ,
139137 ) {
140138 for ty in fn_sig_tys {
141139 let ty = infcx. resolve_vars_if_possible ( ty) ;
142- let implied_bounds = infcx. implied_outlives_bounds ( self . param_env , body_id, ty, span ) ;
140+ let implied_bounds = infcx. implied_outlives_bounds ( self . param_env , body_id, ty) ;
143141 self . add_outlives_bounds ( Some ( infcx) , implied_bounds)
144142 }
145143 }
@@ -166,18 +164,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
166164 rcx. fcx . skip_region_resolution ( ) ;
167165 }
168166
169- /// Region checking during the WF phase for items. `wf_tys` are the
170- /// types from which we should derive implied bounds, if any.
171- #[ instrument( level = "debug" , skip( self ) ) ]
172- pub fn regionck_item ( & self , item_id : hir:: HirId , span : Span , wf_tys : FxHashSet < Ty < ' tcx > > ) {
173- let body_owner = self . tcx . hir ( ) . local_def_id ( item_id) ;
174- let mut rcx = RegionCtxt :: new ( self , body_owner, self . param_env ) ;
175- rcx. outlives_environment . add_implied_bounds ( self , wf_tys, item_id, span) ;
176- rcx. outlives_environment . save_implied_bounds ( rcx. body_id ( ) ) ;
177- rcx. visit_region_obligations ( item_id) ;
178- rcx. resolve_regions_and_report_errors ( ) ;
179- }
180-
181167 /// Region check a function body. Not invoked on closures, but
182168 /// only on the "root" fn item (in which closures may be
183169 /// embedded). Walks the function body and adds various add'l
@@ -190,19 +176,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
190176 & self ,
191177 fn_id : hir:: HirId ,
192178 body : & ' tcx hir:: Body < ' tcx > ,
193- span : Span ,
194179 wf_tys : FxHashSet < Ty < ' tcx > > ,
195180 ) {
196181 debug ! ( "regionck_fn(id={})" , fn_id) ;
197182 let body_owner = self . tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ;
198183 let mut rcx = RegionCtxt :: new ( self , body_owner, self . param_env ) ;
199184 // We need to add the implied bounds from the function signature
200- rcx. outlives_environment . add_implied_bounds ( self , wf_tys, fn_id, span ) ;
185+ rcx. outlives_environment . add_implied_bounds ( self , wf_tys, fn_id) ;
201186 rcx. outlives_environment . save_implied_bounds ( fn_id) ;
202187
203188 if !self . errors_reported_since_creation ( ) {
204189 // regionck assumes typeck succeeded
205- rcx. visit_fn_body ( fn_id, body, self . tcx . hir ( ) . span ( fn_id ) ) ;
190+ rcx. visit_fn_body ( fn_id, body) ;
206191 }
207192
208193 // Checked by NLL
@@ -294,7 +279,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
294279 & mut self ,
295280 id : hir:: HirId , // the id of the fn itself
296281 body : & ' tcx hir:: Body < ' tcx > ,
297- span : Span ,
298282 ) {
299283 // When we enter a function, we can derive
300284 debug ! ( "visit_fn_body(id={:?})" , id) ;
@@ -313,7 +297,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
313297 let fn_sig_tys: FxHashSet < _ > =
314298 fn_sig. inputs ( ) . iter ( ) . cloned ( ) . chain ( Some ( fn_sig. output ( ) ) ) . collect ( ) ;
315299
316- self . outlives_environment . add_implied_bounds ( self . fcx , fn_sig_tys, body_id. hir_id , span ) ;
300+ self . outlives_environment . add_implied_bounds ( self . fcx , fn_sig_tys, body_id. hir_id ) ;
317301 self . outlives_environment . save_implied_bounds ( body_id. hir_id ) ;
318302 self . link_fn_params ( body. params ) ;
319303 self . visit_body ( body) ;
@@ -349,15 +333,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
349333 self . select_all_obligations_or_error ( ) ;
350334 }
351335
352- fn resolve_regions_and_report_errors ( & self ) {
353- self . infcx . process_registered_region_obligations (
354- self . outlives_environment . region_bound_pairs_map ( ) ,
355- self . param_env ,
356- ) ;
357-
358- self . fcx . resolve_regions_and_report_errors ( & self . outlives_environment ) ;
359- }
360-
361336 fn constrain_bindings_in_pat ( & mut self , pat : & hir:: Pat < ' _ > ) {
362337 debug ! ( "regionck::visit_pat(pat={:?})" , pat) ;
363338 pat. each_binding ( |_, hir_id, span, _| {
@@ -382,7 +357,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
382357 fk : intravisit:: FnKind < ' tcx > ,
383358 _: & ' tcx hir:: FnDecl < ' tcx > ,
384359 body_id : hir:: BodyId ,
385- span : Span ,
360+ _span : Span ,
386361 hir_id : hir:: HirId ,
387362 ) {
388363 assert ! (
@@ -396,7 +371,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
396371 let env_snapshot = self . outlives_environment . push_snapshot_pre_typeck_child ( ) ;
397372
398373 let body = self . tcx . hir ( ) . body ( body_id) ;
399- self . visit_fn_body ( hir_id, body, span ) ;
374+ self . visit_fn_body ( hir_id, body) ;
400375
401376 // Restore state from previous function.
402377 self . outlives_environment . pop_snapshot_post_typeck_child ( env_snapshot) ;
0 commit comments