@@ -235,18 +235,6 @@ pub struct ScopeTree {
235
235
/// escape into 'static and should have no local cleanup scope.
236
236
rvalue_scopes : FxHashMap < hir:: ItemLocalId , Option < Scope > > ,
237
237
238
- /// Encodes the hierarchy of fn bodies. Every fn body (including
239
- /// closures) forms its own distinct region hierarchy, rooted in
240
- /// the block that is the fn body. This map points from the ID of
241
- /// that root block to the ID of the root block for the enclosing
242
- /// fn, if any. Thus the map structures the fn bodies into a
243
- /// hierarchy based on their lexical mapping. This is used to
244
- /// handle the relationships between regions in a fn and in a
245
- /// closure defined by that fn. See the "Modeling closures"
246
- /// section of the README in infer::region_constraints for
247
- /// more details.
248
- closure_tree : FxHashMap < hir:: ItemLocalId , hir:: ItemLocalId > ,
249
-
250
238
/// If there are any `yield` nested within a scope, this map
251
239
/// stores the `Span` of the last one and its index in the
252
240
/// postorder of the Visitor traversal on the HIR.
@@ -356,23 +344,6 @@ impl ScopeTree {
356
344
self . destruction_scopes . get ( & n) . cloned ( )
357
345
}
358
346
359
- /// Records that `sub_closure` is defined within `sup_closure`. These IDs
360
- /// should be the ID of the block that is the fn body, which is
361
- /// also the root of the region hierarchy for that fn.
362
- pub fn record_closure_parent (
363
- & mut self ,
364
- sub_closure : hir:: ItemLocalId ,
365
- sup_closure : hir:: ItemLocalId ,
366
- ) {
367
- debug ! (
368
- "record_closure_parent(sub_closure={:?}, sup_closure={:?})" ,
369
- sub_closure, sup_closure
370
- ) ;
371
- assert ! ( sub_closure != sup_closure) ;
372
- let previous = self . closure_tree . insert ( sub_closure, sup_closure) ;
373
- assert ! ( previous. is_none( ) ) ;
374
- }
375
-
376
347
pub fn record_var_scope ( & mut self , var : hir:: ItemLocalId , lifetime : Scope ) {
377
348
debug ! ( "record_var_scope(sub={:?}, sup={:?})" , var, lifetime) ;
378
349
assert ! ( var != lifetime. item_local_id( ) ) ;
@@ -474,7 +445,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
474
445
ref var_map,
475
446
ref destruction_scopes,
476
447
ref rvalue_scopes,
477
- ref closure_tree,
478
448
ref yield_in_scope,
479
449
} = * self ;
480
450
@@ -488,7 +458,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
488
458
var_map. hash_stable ( hcx, hasher) ;
489
459
destruction_scopes. hash_stable ( hcx, hasher) ;
490
460
rvalue_scopes. hash_stable ( hcx, hasher) ;
491
- closure_tree. hash_stable ( hcx, hasher) ;
492
461
yield_in_scope. hash_stable ( hcx, hasher) ;
493
462
}
494
463
}
0 commit comments