]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #83348 - osa1:issue83344, r=jackh726
authorYuki Okushi <huyuumi.dev@gmail.com>
Sat, 27 Mar 2021 16:33:13 +0000 (01:33 +0900)
committerGitHub <noreply@github.com>
Sat, 27 Mar 2021 16:33:13 +0000 (01:33 +0900)
commit973fb4b77feb589cd8fe4c0f5ee2454b246a1532
tree63064f4bc45cb025d9ef27074c86a8393b15cdea
parent1f33a6a0daa472260aacd6788a84b27ba2c57f2b
parent5b9bac2ab62063229c419909f89a41890c57f78f
Rollup merge of #83348 - osa1:issue83344, r=jackh726

format macro argument parsing fix

When the character next to `{}` is "shifted" (when mapping a byte index
in the format string to span) we should avoid shifting the span end
index, so first map the index of `}` to span, then bump the span,
instead of first mapping the next byte index to a span (which causes
bumping the end span too much).

Regression test added.

Fixes #83344

---

r? ```@estebank```
compiler/rustc_parse_format/src/lib.rs