about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorPreston From <prestonfrom@gmail.com>2022-07-16 15:13:14 -0600
committerPreston From <prestonfrom@gmail.com>2022-07-25 00:00:27 -0600
commitaf8ae10678612959a5d6036e0b99aca688b3e545 (patch)
tree31c69e43ca76d379c2cf43fec2b914f3ac5a3658 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
parent632f9945d60c6338a38d385c59c6c9b5f3f5e94d (diff)
downloadrust-af8ae10678612959a5d6036e0b99aca688b3e545.tar.gz
rust-af8ae10678612959a5d6036e0b99aca688b3e545.zip
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/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions