rust-analyzer/crates/hir-ty
Chayim Refael Friedman 4e475a3245 Store some hir_def Paths in the type ref source maps
Most paths are types and therefore already are in the source map, but the trait in impl trait and in bounds are not.

We do this by storing them basically as `TypeRef`s. For convenience, I created a wrapper around `TypeRefId` called `PathId` that always stores a path, and implemented indexing from the types map to it.

Fortunately, this change impacts memory usage negligibly (adds 2mb to `analysis-stats .`, but that could be just fluff). Probably because there aren't that many trait bounds and impl traits, and this also shrinks `TypeBound` by 8 bytes.

I also added an accessor to `TypesSourceMap` to get the source code, which will be needed for diagnostics.
2024-12-04 14:09:50 +02:00
..
src Store some hir_def Paths in the type ref source maps 2024-12-04 14:09:50 +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