-
Notifications
You must be signed in to change notification settings - Fork 13.4k
String/character escape rules do not match the reference #29470
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
Comments
The reference is incomplete, the full list is
|
@petrochenkov the reference includes all of your examples, except:
|
And I think this restriction is made on purpose. It does not make sense to have |
cc @rust-lang/lang is the compiler too accepting here, or is this a docs bug? |
/me shrugs |
I agree with @nrc. I think it'd actually be more confusing to have the same sequence (e.g., |
Okay! Moving to docs bug then. |
The reference does not allow
\'
escape inside strings, and neither\"
inside character literals. This makes sense, as the backslash is redundant in these cases. However, the compiler accepts both: http://is.gd/CDBzp1The text was updated successfully, but these errors were encountered: