-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Hint on unknown escape of Unicode quotation marks in string literal #128906
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
dbg!("since when is \“THIS\” not allowed in a string literal"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: unknown character escape: `\u{201c}` | ||
--> $DIR/unicode-quote.rs:2:26 | ||
| | ||
LL | 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. | ||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: the
and a
(exact wording may vary) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does rustc have a database of unicode character names? |
||
|
||
error: unknown character escape: `\u{201d}` | ||
--> $DIR/unicode-quote.rs:2:32 | ||
| | ||
LL | 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. | ||
|
||
error: aborting due to 2 previous errors | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the spacing is a bit awkward here. Can we use a semicolon to turn this into one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm pretty sure that would put it over the 100 char line length limit.
i'm also unsure if you have a problem with the formatting of the output or the code (the code is 4 lines, but the actual output is only 2)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output -- we don't typically have multi-line diagnostics (unless formatting a list or something), and we try to avoid periods in diagnostic outputs as a matter of style. I personally find multi-sentence notes to be a bit wordy.
Yeah, you'll need to re-
\
the string literal.