Rollup merge of #120386 - klensy:destruction_scopes, r=compiler-errors

ScopeTree: remove destruction_scopes as unused

last usages removed by https://github.com/rust-lang/rust/pull/116170

Unused, but still presented in memory at `t-gmax` (in DHAT termonology)
This commit is contained in:
Matthias Krüger 2024-01-27 10:48:48 +01:00 committed by GitHub
commit 58db961d71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,9 +221,6 @@ pub struct ScopeTree {
/// variable is declared. /// variable is declared.
var_map: FxIndexMap<hir::ItemLocalId, Scope>, var_map: FxIndexMap<hir::ItemLocalId, Scope>,
/// Maps from a `NodeId` to the associated destruction scope (if any).
destruction_scopes: FxIndexMap<hir::ItemLocalId, Scope>,
/// Identifies expressions which, if captured into a temporary, ought to /// Identifies expressions which, if captured into a temporary, ought to
/// have a temporary whose lifetime extends to the end of the enclosing *block*, /// have a temporary whose lifetime extends to the end of the enclosing *block*,
/// and not the enclosing *statement*. Expressions that are not present in this /// and not the enclosing *statement*. Expressions that are not present in this
@ -336,11 +333,6 @@ pub fn record_scope_parent(&mut self, child: Scope, parent: Option<(Scope, Scope
let prev = self.parent_map.insert(child, p); let prev = self.parent_map.insert(child, p);
assert!(prev.is_none()); assert!(prev.is_none());
} }
// Record the destruction scopes for later so we can query them.
if let ScopeData::Destruction = child.data {
self.destruction_scopes.insert(child.item_local_id(), child);
}
} }
pub fn record_var_scope(&mut self, var: hir::ItemLocalId, lifetime: Scope) { pub fn record_var_scope(&mut self, var: hir::ItemLocalId, lifetime: Scope) {