diff options
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/middle/region.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/rvalue_scopes.rs | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs index 66ece8f0e52..ba31f775b65 100644 --- a/compiler/rustc_middle/src/middle/region.rs +++ b/compiler/rustc_middle/src/middle/region.rs @@ -199,8 +199,6 @@ impl Scope { } } -pub type ScopeDepth = u32; - /// The region scope tree encodes information about region relationships. #[derive(Default, Debug, HashStable)] pub struct ScopeTree { @@ -213,7 +211,7 @@ pub struct ScopeTree { /// conditional expression or repeating block. (Note that the /// enclosing scope ID for the block associated with a closure is /// the closure itself.) - pub parent_map: FxIndexMap<Scope, (Scope, ScopeDepth)>, + pub parent_map: FxIndexMap<Scope, Scope>, /// Maps from a variable or binding ID to the block in which that /// variable is declared. @@ -328,7 +326,7 @@ pub struct YieldData { } impl ScopeTree { - pub fn record_scope_parent(&mut self, child: Scope, parent: Option<(Scope, ScopeDepth)>) { + pub fn record_scope_parent(&mut self, child: Scope, parent: Option<Scope>) { debug!("{:?}.parent = {:?}", child, parent); if let Some(p) = parent { @@ -353,7 +351,7 @@ impl ScopeTree { /// Returns the narrowest scope that encloses `id`, if any. pub fn opt_encl_scope(&self, id: Scope) -> Option<Scope> { - self.parent_map.get(&id).cloned().map(|(p, _)| p) + self.parent_map.get(&id).cloned() } /// Returns the lifetime of the local variable `var_id`, if any. diff --git a/compiler/rustc_middle/src/ty/rvalue_scopes.rs b/compiler/rustc_middle/src/ty/rvalue_scopes.rs index b00c8169a36..9bf6e3a7590 100644 --- a/compiler/rustc_middle/src/ty/rvalue_scopes.rs +++ b/compiler/rustc_middle/src/ty/rvalue_scopes.rs @@ -38,7 +38,7 @@ impl RvalueScopes { let mut id = Scope { local_id: expr_id, data: ScopeData::Node }; let mut backwards_incompatible = None; - while let Some(&(p, _)) = region_scope_tree.parent_map.get(&id) { + while let Some(&p) = region_scope_tree.parent_map.get(&id) { match p.data { ScopeData::Destruction => { debug!("temporary_scope({expr_id:?}) = {id:?} [enclosing]"); |
