From da1697121e0fb8e8f2fbc984d07ccfbb73e5905a Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 20 Aug 2023 11:35:49 -0400 Subject: [PATCH] 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. --- crates/ruff_python_semantic/src/model.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ruff_python_semantic/src/model.rs b/crates/ruff_python_semantic/src/model.rs index 85e084843d..d40ac8ed56 100644 --- a/crates/ruff_python_semantic/src/model.rs +++ b/crates/ruff_python_semantic/src/model.rs @@ -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, expr_id: Option, + branch_id: Option, definition_id: DefinitionId, flags: SemanticModelFlags, }