Skip to content
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

parse_format: treat r" as a literal #81828

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

davidhewitt
Copy link
Contributor

This PR changes format_args! internal parsing machinery to treat raw strings starting r" as a literal.

Currently " and r# are recognised as valid starting combinations for string literals, but r" is not.

This was noticed when debugging #67984 (comment)

As well as fixing the behavior observed in that comment, this improves diagnostic spans for r" formatting strings.

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2021
@davidhewitt
Copy link
Contributor Author

cc @mbartlett21 who reported original comment.

@estebank
Copy link
Contributor

estebank commented Feb 8, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 8, 2021

📌 Commit 04a19b9 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2021
Rollup of 9 pull requests

Successful merges:

 - rust-lang#71531 (Move treat err as bug tests to ui)
 - rust-lang#81356 (libtest: allow multiple filters)
 - rust-lang#81735 (faster few span methods)
 - rust-lang#81779 (improve error message for disallowed ptr-to-int casts in const eval)
 - rust-lang#81817 (Add option to emit compiler stderr per bitwidth.)
 - rust-lang#81828 (parse_format: treat r" as a literal)
 - rust-lang#81840 (fix formatting of std::iter::Map)
 - rust-lang#81861 (Show MIR bytes separately in -Zmeta-stats output)
 - rust-lang#81865 (Clean up weird Option mapping)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b9045fa into rust-lang:master Feb 8, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 8, 2021
@davidhewitt davidhewitt deleted the capture-raw-format-strings branch February 8, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants