rust/compiler/rustc_ast_lowering
Dylan DPC a3eb2f0f22
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.)
2023-03-29 14:07:28 +05:30
..
src Rollup merge of #109664 - m-ou-se:format-args-placeholder-span, r=oli-obk 2023-03-29 14:07:28 +05:30
Cargo.toml Upgrade thin-vec from 0.2.9 to 0.2.12. 2023-02-21 11:51:55 +11:00
messages.ftl Simplify message paths 2023-03-11 22:51:57 +01:00