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

Hint on unknown escape of Unicode quotation marks in string literal #137067

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

LFS6502
Copy link
Contributor

@LFS6502 LFS6502 commented Feb 15, 2025

Fixes #128858
Continuation of #128906

Fixes rust-lang#128858

I opted not to produce a suggestion, since it's not obvious what the user meant to do.
@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 15, 2025
@rust-log-analyzer

This comment has been minimized.

@LFS6502
Copy link
Contributor Author

LFS6502 commented Feb 15, 2025

closes #128906

@LFS6502 LFS6502 marked this pull request as ready for review February 17, 2025 20:47
@LFS6502
Copy link
Contributor Author

LFS6502 commented Feb 17, 2025

@jieyouxu @compiler-errors @Dylan-DPC If you've got some spare time, I'd love some input from you too.

I will squash at the end.

@LFS6502
Copy link
Contributor Author

LFS6502 commented Feb 17, 2025

error: unknown character escape: `\u{201c}`
 --> src/main.rs:2:26
  |
2 |     dbg!("since when is \“THIS\” not allowed in a string literal");
  |                          ^ unknown character escape
  |
  = help: \u{201c} is not an ascii quote, but may look like one in some fonts; consider writing it in its escaped form for clarity.
help: if you meant to use a unicode quote; consider using its escaped form for clarity
  |
2 -     dbg!("since when is \“THIS\” not allowed in a string literal");
2 +     dbg!("since when is \u{201c}THIS\” not allowed in a string literal");
  |

error: unknown character escape: `\u{201d}`
 --> src/main.rs:2:32
  |
2 |     dbg!("since when is \“THIS\” not allowed in a string literal");
  |                                ^ unknown character escape
  |
  = help: \u{201d} is not an ascii quote, but may look like one in some fonts; consider writing it in its escaped form for clarity.
help: if you meant to use a unicode quote; consider using its escaped form for clarity
  |
2 -     dbg!("since when is \“THIS\” not allowed in a string literal");
2 +     dbg!("since when is \“THIS\u{201d} not allowed in a string literal");
  |

error: could not compile `diag` (bin "diag") due to 2 previous errors

In image form:

image

@LFS6502 LFS6502 added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` labels Mar 1, 2025
@apiraino
Copy link
Contributor

Assigning review to Michael because of this comment in the previous version of a patch.

r? @compiler-errors

@compiler-errors
Copy link
Member

kinda busy so re-rolling

r? compiler

@rustbot rustbot assigned Noratrieb and unassigned compiler-errors Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hint on unknown escape of Unicode quotation marks in string literal
8 participants