diff options
| author | bors <bors@rust-lang.org> | 2024-08-29 08:14:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-29 08:14:04 +0000 |
| commit | cd377d90db6aeba3d528c7f594ec16fee6a58e74 (patch) | |
| tree | edf35a613da37831c08984c9da8549031ea5e66e /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | b6d0fd03e110f1d7a46410867fbe32e056e087ac (diff) | |
| parent | 3ff3d39b96584fc263facc002c723e7c8d8c5a85 (diff) | |
| download | rust-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
