mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-23 00:31:55 +00:00
![]() ## Summary Type visitors are conceptually immutable, they just internally track the types they've seen (and some maintain a cache of results.) Passing around mutable visitors everywhere can get us into borrow-checker trouble in some cases, where we need to recursively pass along the visitor inside more than one closure with non-disjoint lifetime. Use interior mutability (via `RefCell` and `Cell`) inside the visitors instead, to allow us to pass around shared references. ## Test Plan Existing tests. |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
mdtest.py | ||
mdtest.py.lock |