-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect format string span when specifier is followed by backslash #83344
Comments
@rustbot claim |
This was referenced Mar 21, 2021
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Mar 26, 2021
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 rust-lang#83344 --- r? `@estebank`
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Mar 27, 2021
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 rust-lang#83344 --- r? ``@estebank``
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Mar 27, 2021
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 rust-lang#83344 --- r? `@estebank`
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Mar 27, 2021
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 rust-lang#83344 --- r? ``@estebank``
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Mar 27, 2021
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 rust-lang#83344 --- r? ```@estebank```
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Apr 8, 2021
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 rust-lang#83344
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discovered this while debugging #83340. Repro:
Current output:
I think the span for
{}
is wrong. With the correct span the error would look like:The span is correct when
{}
is followed by any other character:Output:
The text was updated successfully, but these errors were encountered: