mirror of https://github.com/astral-sh/ruff
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
|
|
@ -1193,6 +1193,7 @@ impl<'a> SemanticModel<'a> {
|
||||||
scope_id: self.scope_id,
|
scope_id: self.scope_id,
|
||||||
stmt_id: self.statement_id,
|
stmt_id: self.statement_id,
|
||||||
expr_id: self.expression_id,
|
expr_id: self.expression_id,
|
||||||
|
branch_id: self.branch_id,
|
||||||
definition_id: self.definition_id,
|
definition_id: self.definition_id,
|
||||||
flags: self.flags,
|
flags: self.flags,
|
||||||
}
|
}
|
||||||
|
|
@ -1204,12 +1205,14 @@ impl<'a> SemanticModel<'a> {
|
||||||
scope_id,
|
scope_id,
|
||||||
stmt_id,
|
stmt_id,
|
||||||
expr_id,
|
expr_id,
|
||||||
|
branch_id,
|
||||||
definition_id,
|
definition_id,
|
||||||
flags,
|
flags,
|
||||||
} = snapshot;
|
} = snapshot;
|
||||||
self.scope_id = scope_id;
|
self.scope_id = scope_id;
|
||||||
self.statement_id = stmt_id;
|
self.statement_id = stmt_id;
|
||||||
self.expression_id = expr_id;
|
self.expression_id = expr_id;
|
||||||
|
self.branch_id = branch_id;
|
||||||
self.definition_id = definition_id;
|
self.definition_id = definition_id;
|
||||||
self.flags = flags;
|
self.flags = flags;
|
||||||
}
|
}
|
||||||
|
|
@ -1624,6 +1627,7 @@ pub struct Snapshot {
|
||||||
scope_id: ScopeId,
|
scope_id: ScopeId,
|
||||||
stmt_id: Option<StatementId>,
|
stmt_id: Option<StatementId>,
|
||||||
expr_id: Option<ExpressionId>,
|
expr_id: Option<ExpressionId>,
|
||||||
|
branch_id: Option<BranchId>,
|
||||||
definition_id: DefinitionId,
|
definition_id: DefinitionId,
|
||||||
flags: SemanticModelFlags,
|
flags: SemanticModelFlags,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue