Description
This is a tracking issue for the RFC 3349 (rust-lang/rfcs#3349).
The feature gate for the issue is #![feature(mixed_utf8_literals)]
.
From the RFC:
Relax the restrictions on which characters and escape codes are allowed in string, char, byte string, and byte literals.
Most importantly, this means we accept the exact same characters and escape codes in
"…"
andb"…"
literals. That is:
- Allow unicode characters, including
\u{…}
escape codes, in byte string literals. E.g.b"hello\xff我叫\u{1F980}"
- Also allow non-ASCII
\x…
escape codes in regular string literals, as long as they are valid UTF-8. E.g."\xf0\x9f\xa6\x80"
About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Should
concat!("\xf0\x9f", "\xa6\x80")
work? (The string literals are not valid UTF-8 individually, but are valid UTF-8 after being concatenated.)