about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2024-11-19 19:57:07 +0200
committerChayim Refael Friedman <chayimfr@gmail.com>2024-12-04 14:09:50 +0200
commit2a949d8725a1027ffe8ef49c1303bc95d6192ce8 (patch)
tree221b2bfbd5aa16ee5c04f60ab012d37de16dc9a8 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent609621db7fc830d4cc81fa9aeb4aca297f9fb158 (diff)
downloadrust-2a949d8725a1027ffe8ef49c1303bc95d6192ce8.tar.gz
rust-2a949d8725a1027ffe8ef49c1303bc95d6192ce8.zip
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions