@@ -108,7 +108,6 @@ pub(crate) trait OutlivesEnvironmentExt<'tcx> {
108
108
infcx : & InferCtxt < ' _ , ' tcx > ,
109
109
fn_sig_tys : FxHashSet < Ty < ' tcx > > ,
110
110
body_id : hir:: HirId ,
111
- span : Span ,
112
111
) ;
113
112
}
114
113
@@ -135,11 +134,10 @@ impl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx> {
135
134
infcx : & InferCtxt < ' a , ' tcx > ,
136
135
fn_sig_tys : FxHashSet < Ty < ' tcx > > ,
137
136
body_id : hir:: HirId ,
138
- span : Span ,
139
137
) {
140
138
for ty in fn_sig_tys {
141
139
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) ;
143
141
self . add_outlives_bounds ( Some ( infcx) , implied_bounds)
144
142
}
145
143
}
@@ -166,18 +164,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
166
164
rcx. fcx . skip_region_resolution ( ) ;
167
165
}
168
166
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
-
181
167
/// Region check a function body. Not invoked on closures, but
182
168
/// only on the "root" fn item (in which closures may be
183
169
/// embedded). Walks the function body and adds various add'l
@@ -190,19 +176,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
190
176
& self ,
191
177
fn_id : hir:: HirId ,
192
178
body : & ' tcx hir:: Body < ' tcx > ,
193
- span : Span ,
194
179
wf_tys : FxHashSet < Ty < ' tcx > > ,
195
180
) {
196
181
debug ! ( "regionck_fn(id={})" , fn_id) ;
197
182
let body_owner = self . tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ;
198
183
let mut rcx = RegionCtxt :: new ( self , body_owner, self . param_env ) ;
199
184
// 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) ;
201
186
rcx. outlives_environment . save_implied_bounds ( fn_id) ;
202
187
203
188
if !self . errors_reported_since_creation ( ) {
204
189
// 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) ;
206
191
}
207
192
208
193
// Checked by NLL
@@ -294,7 +279,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
294
279
& mut self ,
295
280
id : hir:: HirId , // the id of the fn itself
296
281
body : & ' tcx hir:: Body < ' tcx > ,
297
- span : Span ,
298
282
) {
299
283
// When we enter a function, we can derive
300
284
debug ! ( "visit_fn_body(id={:?})" , id) ;
@@ -313,7 +297,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
313
297
let fn_sig_tys: FxHashSet < _ > =
314
298
fn_sig. inputs ( ) . iter ( ) . cloned ( ) . chain ( Some ( fn_sig. output ( ) ) ) . collect ( ) ;
315
299
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 ) ;
317
301
self . outlives_environment . save_implied_bounds ( body_id. hir_id ) ;
318
302
self . link_fn_params ( body. params ) ;
319
303
self . visit_body ( body) ;
@@ -349,15 +333,6 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
349
333
self . select_all_obligations_or_error ( ) ;
350
334
}
351
335
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
-
361
336
fn constrain_bindings_in_pat ( & mut self , pat : & hir:: Pat < ' _ > ) {
362
337
debug ! ( "regionck::visit_pat(pat={:?})" , pat) ;
363
338
pat. each_binding ( |_, hir_id, span, _| {
@@ -382,7 +357,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
382
357
fk : intravisit:: FnKind < ' tcx > ,
383
358
_: & ' tcx hir:: FnDecl < ' tcx > ,
384
359
body_id : hir:: BodyId ,
385
- span : Span ,
360
+ _span : Span ,
386
361
hir_id : hir:: HirId ,
387
362
) {
388
363
assert ! (
@@ -396,7 +371,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
396
371
let env_snapshot = self . outlives_environment . push_snapshot_pre_typeck_child ( ) ;
397
372
398
373
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) ;
400
375
401
376
// Restore state from previous function.
402
377
self . outlives_environment . pop_snapshot_post_typeck_child ( env_snapshot) ;
0 commit comments