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>2022-07-29 04:23:08 +0000
committerbors <bors@rust-lang.org>2022-07-29 04:23:08 +0000
commit61c6d16adef2a55a2cefbeb8c3ac19f0af67a479 (patch)
tree3abcf03b60249b78e8bece7a368620fbe93b3fee /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent67c405cc1d6cc898cf26586dfe68390cc05a8e40 (diff)
parentaf8ae10678612959a5d6036e0b99aca688b3e545 (diff)
downloadrust-61c6d16adef2a55a2cefbeb8c3ac19f0af67a479.tar.gz
rust-61c6d16adef2a55a2cefbeb8c3ac19f0af67a479.zip
Auto merge of #99660 - PrestonFrom:issue_99265, r=compiler-errors
Generate correct suggestion with named arguments used positionally

Address issue #99265 by checking each positionally used argument
to see if the argument is named and adding a lint to use the name
instead. This way, when named arguments are used positionally in a
different order than their argument order, the suggested lint is
correct.

For example:
```
println!("{b} {}", a=1, b=2);
```
This will now generate the suggestion:
```
println!("{b} {a}", a=1, b=2);
```

Additionally, this check now also correctly replaces or inserts
only where the positional argument is (or would be if implicit).
Also, width and precision are replaced with their argument names
when they exists.

Since the issues were so closely related, this fix for issue #99265
also fixes issue #99266.

Fixes #99265
Fixes #99266
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions