mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 01:51:30 +00:00
Move dead_scopes
to deferred.scopes
(#5171)
## Summary This is more consistent with the rest of the `deferred` patterns.
This commit is contained in:
parent
524a2045ba
commit
a6cf31cc89
3 changed files with 9 additions and 8 deletions
|
@ -40,7 +40,6 @@ pub struct SemanticModel<'a> {
|
|||
/// Stack of all scopes, along with the identifier of the current scope.
|
||||
pub scopes: Scopes<'a>,
|
||||
pub scope_id: ScopeId,
|
||||
pub dead_scopes: Vec<ScopeId>,
|
||||
|
||||
/// Stack of all definitions created in any scope, at any point in execution.
|
||||
pub definitions: Definitions<'a>,
|
||||
|
@ -130,7 +129,6 @@ impl<'a> SemanticModel<'a> {
|
|||
exprs: Vec::default(),
|
||||
scopes: Scopes::default(),
|
||||
scope_id: ScopeId::global(),
|
||||
dead_scopes: Vec::default(),
|
||||
definitions: Definitions::for_module(module),
|
||||
definition_id: DefinitionId::module(),
|
||||
bindings: Bindings::default(),
|
||||
|
@ -596,7 +594,6 @@ impl<'a> SemanticModel<'a> {
|
|||
|
||||
/// Pop the current [`Scope`] off the stack.
|
||||
pub fn pop_scope(&mut self) {
|
||||
self.dead_scopes.push(self.scope_id);
|
||||
self.scope_id = self.scopes[self.scope_id]
|
||||
.parent
|
||||
.expect("Attempted to pop without scope");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue