about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-20 15:04:25 +0000
committerbors <bors@rust-lang.org>2024-01-20 15:04:25 +0000
commit70573af31eb9b8431c2e7923325c82ba0304cbb2 (patch)
treeffad749a697c68dbb53792c7c5f1239d7262c16a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent989ce17b5564ca5414da234df6aa4b247f946c91 (diff)
parent0774489086504093fe09bdafeb4c9f3e4739b138 (diff)
downloadrust-70573af31eb9b8431c2e7923325c82ba0304cbb2.tar.gz
rust-70573af31eb9b8431c2e7923325c82ba0304cbb2.zip
Auto merge of #12147 - y21:needless_pass_by_ref_mut_rm_visitor, r=llogiq
Find function path references early in the same lint pass

This removes a visitor that existed to collect paths to functions in a context where the exact signature is required in order to cancel the lint.
E.g. when there's a `let _: fn(&mut i32) = path_to_fn_ref_mut_i32;` statement somewhere in the crate, we shouldn't suggest removing the mutable reference in the function signature.

It was doing a whole pass through the crate at the end, which seems unnecessary.
It seems like we should be able to add entries to the map in the same lint pass.
The map is untouched all the way until `check_crate_post` (at which point it will be populated by the visitor and finally checked), so it doesn't seem like this changes behavior: it will only be fully populated by the time we reach `check_crate_post` no matter what.

I don't think this will have a significant perf impact but it did show up in a profile with 0.5% for a crate I was looking into and looked like a low hanging fruit.

changelog: none
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions