diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-08-29 00:10:26 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-08-29 00:10:26 +0300 |
| commit | fe5f91ed8e54eeac1cc81930982d01483d745a65 (patch) | |
| tree | 3efa56d8782a28f0b508c4b85fb089882e5744e7 /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | 2a7ec0b0ad0b9d7aea147694c23b5f52b6dc6fa9 (diff) | |
| download | rust-fe5f91ed8e54eeac1cc81930982d01483d745a65.tar.gz rust-fe5f91ed8e54eeac1cc81930982d01483d745a65.zip | |
Don't add reference when it isn't needed for the "Extract variable" assist
I.e. don't generate `let var_name = &foo()`. 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_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
