diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-03-29 14:07:28 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 14:07:28 +0530 |
| commit | a3eb2f0f222d628440975b58589fc75994403a97 (patch) | |
| tree | 057e1850ab635a1097e2f8b519f5bef4d8bcee9e /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | 39f93d3c98044e246782fd421021f971b612bf5f (diff) | |
| parent | 6c72a002a68043f9bc67399c43a66e8ab68ca20b (diff) | |
| download | rust-a3eb2f0f222d628440975b58589fc75994403a97.tar.gz rust-a3eb2f0f222d628440975b58589fc75994403a97.zip | |
Rollup merge of #109664 - m-ou-se:format-args-placeholder-span, r=oli-obk
Use span of placeholders in format_args!() expansion.
`format_args!("{}", x)` expands to something that contains `Argument::new_display(&x)`. That entire expression was generated with the span of `x`.
After this PR, `&x` uses the span of `x`, but the `new_display` call uses the span of the `{}` placeholder within the format string. If an implicitly captured argument was used like in `format_args!("{x}")`, both use the span of the `{x}` placeholder.
This fixes https://github.com/rust-lang/rust/issues/109576, and also allows for more improvements to similar diagnostics in the future, since the usage of `x` can now be traced to the exact `{}` placeholder that required it to be `Display` (or `Debug` etc.)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions
