mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
![]() The switch to `Arc` was done because Salsa sometimes requires cloning a `Diagnostic` (or something that contains a `Diagnostic`). And so it probably makes sense to make this cheap. Since `Diagnostic` exposes a mutable API, we adopt "clone on write" semantics. Although, it's more like, "clone on write when the `Arc` has more than one reference." In the common case of creating a `Diagnostic` and then immediately mutating it, no additional copies should be made over the status quo. We also drop the linear type fakery. Its interaction with Salsa is somewhat awkward, and it has been suggested that there will be points where diagnostics will be dropped unceremoniously without an opportunity to tag them as having been ignored. Moreover, this machinery was added out of "good sense" and isn't actually motivated by real world problems with accidentally ignoring diagnostics. So that makes it easier, I think, to just kick this out entirely instead of trying to find a way to make it work. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |