diff options
| author | bors <bors@rust-lang.org> | 2017-10-26 14:14:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-26 14:14:15 +0000 |
| commit | b0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31 (patch) | |
| tree | 011c1b2fa731579f0a7079e3415f1e08d35c06bf /src/libstd/lib.rs | |
| parent | e0febe71449008fd35ccc762b0a42d106aa8e4f7 (diff) | |
| parent | 8ad7c284d793250edffe0e85f6cc898585496283 (diff) | |
| download | rust-b0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31.tar.gz rust-b0b80f8c2299cccd7a4f22ee3cc1a2ca823eaa31.zip | |
Auto merge of #45380 - dotdash:arg_copies, r=arielb1
Avoid unnecessary copies of arguments that are simple bindings Initially MIR differentiated between arguments and locals, which introduced a need to add extra copies assigning the argument to a local, even for simple bindings. This differentiation no longer exists, but we're still creating those copies, bloating the MIR and LLVM IR we emit. Additionally, the current approach means that we create debug info for both the incoming argument (marking it as an argument), and then immediately shadow it a local that goes by the same name. This can be confusing when using e.g. "info args" in gdb, or when e.g. a debugger with a GUI displays the function arguments separately from the local variables, especially when the binding is mutable, because the argument doesn't change, while the local variable does.
Diffstat (limited to 'src/libstd/lib.rs')
0 files changed, 0 insertions, 0 deletions
