about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-29 08:14:04 +0000
committerbors <bors@rust-lang.org>2024-08-29 08:14:04 +0000
commitcd377d90db6aeba3d528c7f594ec16fee6a58e74 (patch)
treeedf35a613da37831c08984c9da8549031ea5e66e /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentb6d0fd03e110f1d7a46410867fbe32e056e087ac (diff)
parent3ff3d39b96584fc263facc002c723e7c8d8c5a85 (diff)
downloadrust-cd377d90db6aeba3d528c7f594ec16fee6a58e74.tar.gz
rust-cd377d90db6aeba3d528c7f594ec16fee6a58e74.zip
Auto merge of #17991 - ChayimFriedman2:extract-variable-ref, r=Veykril
fix: Don't add reference when it isn't needed for the "Extract variable" assist

I.e. don't generate `let var_name = &foo()`. Because it always irritates me when I need to fix that.

Anything that creates a new value don't need a reference. That excludes mostly field accesses and indexing.

I had a thought that we can also not generate a reference for fields and indexing as long as the type is `Copy`, but sometimes people impl `Copy` even when they don't want to copy the values (e.g. a large type), so I didn't do that.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions