]> git.lizzy.rs Git - rust.git/commit
Auto merge of #103828 - cassaundra:fix-format-args-span2, r=cjgillot
authorbors <bors@rust-lang.org>
Mon, 26 Dec 2022 12:03:47 +0000 (12:03 +0000)
committerbors <bors@rust-lang.org>
Mon, 26 Dec 2022 12:03:47 +0000 (12:03 +0000)
commit731e0bf721c1ec2c7843547e86b6157b40a437d1
tree2adf07470f23ec77fecd22bae1c7c1366ebe9da6
parentf206533fd40378da6e2a07567e8d7592edd13ee4
parent35c7939ae5d3a0e34963bbd57bbc4b91c3ce0ce3
Auto merge of #103828 - cassaundra:fix-format-args-span2, r=cjgillot

Fix incorrect span when using byte-escaped rbrace

Fix #103826, a format args span issue introduced in #102214.

The current solution for tracking skipped characters made it so that certain situations were ambiguous enough that the original span couldn't be worked out later. This PR improves on the original solution by keeping track of groups of skipped characters using a map, and fixes the previous bug. See an example of this ambiguity in the [previous PR's discussion](https://github.com/rust-lang/rust/pull/102214#issuecomment-1258711015).
compiler/rustc_parse_format/src/lib.rs