about summary refs log tree commit diff
path: root/tests/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-19 15:55:05 +0000
committerbors <bors@rust-lang.org>2022-08-19 15:55:05 +0000
commit3e594de8ec79f89415c610f32c4f1b05a9e393b8 (patch)
tree0adf7006560ef4250a540f287730e6a08ed2f0fc /tests/debuginfo/enum-thinlto.rs
parent477c16d45bb93cc92611b56614ce2b823bffab8d (diff)
parent4f049f5a695b003168125a3251f5c0295e64f261 (diff)
downloadrust-3e594de8ec79f89415c610f32c4f1b05a9e393b8.tar.gz
rust-3e594de8ec79f89415c610f32c4f1b05a9e393b8.zip
Auto merge of #9349 - Alexendoo:format-args-expn, r=flip1995
Refactor `FormatArgsExpn`

It now for each format argument `{..}` has:
- The `Expr` it points to, and how it does so (named/named inline/numbered/implicit)
- The parsed `FormatSpec` (format trait/fill/align/etc., the precision/width and any value they point to)
- Many spans

The caller no longer needs to pair up arguments to their value, or separately interpret the `specs` `Expr`s when it isn't `None`

The gist is that it combines the result of [`rustc_parse_format::Parser`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse_format/struct.Parser.html) with the macro expansion itself

This unfortunately makes the code a bit longer, however we need to use both as neither have all the information we're after. `rustc_parse_format` doesn't have the information to resolve named arguments to their values. The macro expansion doesn't contain whether the positions are implicit/numbered/named, or the spans for format arguments

Wanted by #9233 and #8518 to be able to port the changes from #9040

Also fixes #8643, previously the format args seem to have been paired up with the wrong values somehow

changelog: [`format_in_format_args`]: Fix false positive due to misattributed arguments

r? `@flip1995`
cc `@nyurik`
Diffstat (limited to 'tests/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions