mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-09 21:28:21 +00:00
Add BranchId
to the model snapshot (#6706)
This _probably_ never matters given the set of rules we support and in fact I'm having trouble thinking of a test-case for it, but it's definitely incorrect _not_ to pass on the `BranchId` here.
This commit is contained in:
parent
419615f29b
commit
da1697121e
1 changed files with 4 additions and 0 deletions
|
@ -1193,6 +1193,7 @@ impl<'a> SemanticModel<'a> {
|
|||
scope_id: self.scope_id,
|
||||
stmt_id: self.statement_id,
|
||||
expr_id: self.expression_id,
|
||||
branch_id: self.branch_id,
|
||||
definition_id: self.definition_id,
|
||||
flags: self.flags,
|
||||
}
|
||||
|
@ -1204,12 +1205,14 @@ impl<'a> SemanticModel<'a> {
|
|||
scope_id,
|
||||
stmt_id,
|
||||
expr_id,
|
||||
branch_id,
|
||||
definition_id,
|
||||
flags,
|
||||
} = snapshot;
|
||||
self.scope_id = scope_id;
|
||||
self.statement_id = stmt_id;
|
||||
self.expression_id = expr_id;
|
||||
self.branch_id = branch_id;
|
||||
self.definition_id = definition_id;
|
||||
self.flags = flags;
|
||||
}
|
||||
|
@ -1624,6 +1627,7 @@ pub struct Snapshot {
|
|||
scope_id: ScopeId,
|
||||
stmt_id: Option<StatementId>,
|
||||
expr_id: Option<ExpressionId>,
|
||||
branch_id: Option<BranchId>,
|
||||
definition_id: DefinitionId,
|
||||
flags: SemanticModelFlags,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue