rust-analyzer/crates/hir-ty
Chayim Refael Friedman 21ad3b5b87 Complete diagnostics in ty lowering groundwork
Implement diagnostics in all places left: generics (predicates, defaults, const params' types), fields, and type aliases.

Unfortunately this results in a 20mb addition in `analysis-stats .` due to many type methods returning an addition diagnostics result now (even if it's `None` in most cases). I'm not sure if this can be improved.

An alternative strategy that can prevent the memory usage growth is to never produce diagnostics in hir-ty methods. Instead, lower all types in the hir crate when computing diagnostics from scratch (with diagnostics this time). But this has two serious disadvantages:
 1. This can cause code duplication (although it can probably be not that bad, it will still mean a lot more code).
 2. I believe we eventually want to compute diagnostics for the *entire* workspace (either on-type or on-save or something alike), so users can know when they have diagnostics even in inactive files. Choosing this approach will mean we lose all precomputed salsa queries. For one file this is fine, for the whole workspace this will be very slow.
2024-12-04 14:22:56 +02:00
..
src Complete diagnostics in ty lowering groundwork 2024-12-04 14:22:56 +02:00
Cargo.toml Replace once_cell with std's recently stabilized OnceCell/Lock and LazyCell/Lock 2024-08-16 09:53:37 +03:00