@@ -235,18 +235,6 @@ pub struct ScopeTree {
235235 /// escape into 'static and should have no local cleanup scope.
236236 rvalue_scopes : FxHashMap < hir:: ItemLocalId , Option < Scope > > ,
237237
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-
250238 /// If there are any `yield` nested within a scope, this map
251239 /// stores the `Span` of the last one and its index in the
252240 /// postorder of the Visitor traversal on the HIR.
@@ -356,23 +344,6 @@ impl ScopeTree {
356344 self . destruction_scopes . get ( & n) . cloned ( )
357345 }
358346
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-
376347 pub fn record_var_scope ( & mut self , var : hir:: ItemLocalId , lifetime : Scope ) {
377348 debug ! ( "record_var_scope(sub={:?}, sup={:?})" , var, lifetime) ;
378349 assert ! ( var != lifetime. item_local_id( ) ) ;
@@ -474,7 +445,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
474445 ref var_map,
475446 ref destruction_scopes,
476447 ref rvalue_scopes,
477- ref closure_tree,
478448 ref yield_in_scope,
479449 } = * self ;
480450
@@ -488,7 +458,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
488458 var_map. hash_stable ( hcx, hasher) ;
489459 destruction_scopes. hash_stable ( hcx, hasher) ;
490460 rvalue_scopes. hash_stable ( hcx, hasher) ;
491- closure_tree. hash_stable ( hcx, hasher) ;
492461 yield_in_scope. hash_stable ( hcx, hasher) ;
493462 }
494463}
0 commit comments