Skip to content

Commit

Permalink
remove redundant assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Mar 12, 2025
1 parent 837f4da commit c7f4213
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions crates/red_knot_python_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,11 @@ impl<'db> From<Symbol<'db>> for SymbolAndQualifiers<'db> {
fn symbol_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &SymbolAndQualifiers<'db>,
count: u32,
_count: u32,
_scope: ScopeId<'db>,
_symbol_id: ScopedSymbolId,
_requires_explicit_reexport: RequiresExplicitReExport,
) -> salsa::CycleRecoveryAction<SymbolAndQualifiers<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down
15 changes: 5 additions & 10 deletions crates/red_knot_python_semantic/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ pub(crate) fn infer_scope_types<'db>(db: &'db dyn Db, scope: ScopeId<'db>) -> Ty
fn scope_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &TypeInference<'db>,
count: u32,
_count: u32,
_scope: ScopeId<'db>,
) -> salsa::CycleRecoveryAction<TypeInference<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down Expand Up @@ -151,10 +150,9 @@ pub(crate) fn infer_definition_types<'db>(
fn definition_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &TypeInference<'db>,
count: u32,
_count: u32,
_definition: Definition<'db>,
) -> salsa::CycleRecoveryAction<TypeInference<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down Expand Up @@ -191,10 +189,9 @@ pub(crate) fn infer_deferred_types<'db>(
fn deferred_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &TypeInference<'db>,
count: u32,
_count: u32,
_definition: Definition<'db>,
) -> salsa::CycleRecoveryAction<TypeInference<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down Expand Up @@ -228,10 +225,9 @@ pub(crate) fn infer_expression_types<'db>(
fn expression_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &TypeInference<'db>,
count: u32,
_count: u32,
_expression: Expression<'db>,
) -> salsa::CycleRecoveryAction<TypeInference<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down Expand Up @@ -275,10 +271,9 @@ pub(crate) fn infer_expression_type<'db>(
fn single_expression_cycle_recover<'db>(
_db: &'db dyn Db,
_value: &Type<'db>,
count: u32,
_count: u32,
_expression: Expression<'db>,
) -> salsa::CycleRecoveryAction<Type<'db>> {
assert!(count < 10, "cycle did not converge within 10 iterations");
salsa::CycleRecoveryAction::Iterate
}

Expand Down

0 comments on commit c7f4213

Please sign in to comment.