about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-03-29 14:07:28 +0530
committerGitHub <noreply@github.com>2023-03-29 14:07:28 +0530
commita3eb2f0f222d628440975b58589fc75994403a97 (patch)
tree057e1850ab635a1097e2f8b519f5bef4d8bcee9e /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent39f93d3c98044e246782fd421021f971b612bf5f (diff)
parent6c72a002a68043f9bc67399c43a66e8ab68ca20b (diff)
downloadrust-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_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions