@@ -64,7 +64,7 @@ impl Violation for SwapWithTemporaryVariable<'_> {
6464
6565pub ( crate ) fn swap_with_temporary_variable ( checker : & Checker , scope_id : ScopeId , scope : & Scope ) {
6666 let consecutive_assignments = scope. binding_ids ( ) . filter_map ( |binding_id| {
67- match_consecutive_assignments ( checker. semantic ( ) , scope_id, binding_id)
67+ match_consecutive_assignments ( checker, checker . semantic ( ) , scope_id, binding_id)
6868 } ) ;
6969
7070 for ( stmt_a, stmt_b, stmt_c) in consecutive_assignments {
@@ -110,6 +110,7 @@ pub(crate) fn swap_with_temporary_variable(checker: &Checker, scope_id: ScopeId,
110110///
111111/// Also see the `repeated_append` rule for a similar use case.
112112fn match_consecutive_assignments < ' a > (
113+ checker : & Checker ,
113114 semantic : & ' a SemanticModel < ' a > ,
114115 scope_id : ScopeId ,
115116 binding_id : BindingId ,
@@ -133,6 +134,10 @@ fn match_consecutive_assignments<'a>(
133134 // Find the enclosing suite so we can look at the next siblings.
134135 // For the global scope, use the module body; otherwise, find the parent statement.
135136 let suite = if scope_id. is_global ( ) {
137+ assert ! (
138+ !checker. is_rule_enabled( crate :: codes:: Rule :: MissingTypeFunctionArgument ) ,
139+ "TODO(brent) remove this"
140+ ) ;
136141 traversal:: EnclosingSuite :: new ( semantic. definitions . python_ast ( ) ?, stmt. into ( ) )
137142 } else {
138143 traversal:: suite ( stmt, semantic. parent_statement ( node_id) ?)
0 commit comments