\xHH escaping suggestions are wrong for characters that are too big #87397
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider this code:
playground
The current output is:
The suggestions are incorrect:
\x5B57
is not a valid escaped character, only the\x5B
part is interpreted as an escaped character while the57
part is interpreted as two normal characters.In the case of byte characters the suggestion leads to a byte character literal with more than one character, thus in another compile error. However in the case of byte strings this will silently compile, even though that probably wasn't what the user wanted nor expected.
This happens in both the current stable and nightly compilers.
The text was updated successfully, but these errors were encountered: