ruff/crates/ty_python_semantic/src/semantic_index
Shunsuke Shibayama 8770b95509
[ty] introduce DivergentType (#20312)
## Summary

From #17371

In #17371, `DivergentType` was introduced to prevent type inference for
recursive functions from diverging and causing panics. This turned out
to be useful for other divergent type inferences
(https://github.com/astral-sh/ruff/pull/17371#discussion_r2329337965),
so I extracted the introduction part of `DivergentType` into this PR so
that we can use it without waiting for the merge of #17371.

Note that this PR only introduces `DivergentType` and does not actually
address divergent type inference yet. Please refer to
https://github.com/astral-sh/ruff/pull/17371/files#diff-20b910c6e20faa962bb1642e111db1cbad8e66ace089bdd966ac9d7f9fa99ff2R542-R622
etc. when implementing handling of divergence suppression using this
type.

## Test Plan

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
2025-09-10 08:32:26 -07:00
..
builder Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
use_def [ty] more precise lazy scope place lookup (#19932) 2025-09-08 21:08:35 +00:00
ast_ids.rs [ty] Split ScopedPlaceId into ScopedSymbolId and ScopedMemberId (#19497) 2025-07-25 13:54:33 +02:00
builder.rs [ty] more precise lazy scope place lookup (#19932) 2025-09-08 21:08:35 +00:00
definition.rs [ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248) 2025-09-05 17:56:06 +01:00
expression.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
member.rs [ty] Fix static assertion size check (#19814) 2025-08-07 13:38:16 -05:00
narrowing_constraints.rs [ty] Split ScopedPlaceId into ScopedSymbolId and ScopedMemberId (#19497) 2025-07-25 13:54:33 +02:00
place.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
predicate.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
re_exports.rs [ty] Avoid overcounting shared memory usage (#19773) 2025-08-06 15:32:02 -04:00
reachability_constraints.rs [ty] No boundness analysis for implicit instance attributes (#20128) 2025-08-28 16:25:07 +02:00
scope.rs [ty] introduce DivergentType (#20312) 2025-09-10 08:32:26 -07:00
symbol.rs [ty] more cases for the class body global fallback 2025-08-07 17:30:27 -07:00
use_def.rs [ty] more precise lazy scope place lookup (#19932) 2025-09-08 21:08:35 +00:00