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

Backslashes in error messages are doubly escaped #47902

Closed
varkor opened this issue Jan 31, 2018 · 0 comments
Closed

Backslashes in error messages are doubly escaped #47902

varkor opened this issue Jan 31, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@varkor
Copy link
Member

varkor commented Jan 31, 2018

Attempting to compile a file containing just \ results in the error: error: unknown start of token: \\, which is incorrect as only one backslash is contained in the file.

@sfackler sfackler added the A-diagnostics Area: Messages for errors, warnings, and lints label Jan 31, 2018
kennytm added a commit to kennytm/rust that referenced this issue Feb 2, 2018
…r-msg, r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes rust-lang#47902
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
Projects
None yet
Development

No branches or pull requests

2 participants