-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking Issue for unicode and escape codes in literals #116907
Comments
@rustbot labels +T-lang |
@rustbot labels +B-rfc-approved |
I would like to take this one. |
I have a partial implementation of this RFC working locally (EDIT: now at #120286). The RFC proposes five changes to literal syntax. I think three of them are good, and two of them aren't necessary.
|
Here's an alternative version of the table that I've been using and found helpful. It shows all the escapes directly instead of grouping them by name, it shows the changes proposed by the RFC (affected literal kinds have two lines connected by a
This makes it easier to see things like adding |
BTW, I have implemented the first three changes. They were pretty easy, and piggy-backed naturally off the existing support for mixed utf8 in C string literals, requiring only minor changes. I haven't implemented the last two. They would both have required new kinds of checks, somewhat annoying to implement, which is what got me thinking about whether they are necessary. |
A complete draft implementation is now at #120286. |
…, r=<try> Implement RFC 3349, mixed utf8 literals RFC: rust-lang/rfcs#3349 Tracking issue: rust-lang#116907 r? `@ghost`
Nominated for lang-team discussion for this comment above. |
cc @m-ou-se, who may want to provide input/responses to the above. |
@nnethercote FWIW, I do feel like having |
Is this a consistency argument? Consider the table. Currently some literals don't support Or maybe it's a Postel's law style "we should accept anything that makes sense" argument? If so, I would immediately ask why? The |
Still waiting for a lang-team response here, ten months later :( |
It seems nice to me that if you have a
Same argument the other wary around: It seems nice that if you have a |
I think it is consistent. I don't see |
These cases seem like they would be extremely rare, and in each case they would only avoid modifying a tiny number of characters. In general I'm interested in new syntax that enables new programs to be written, far more than (a) new syntax that makes potential refactorings marginally easier, or (b) new syntax that (arguably) addresses obscure consistencies in the language that don't cause problems in practice. |
We talked about this in our triage call today. We ended up wanting to read the thread here more carefully, though, so we'll be talking about this again. Our general sentiment was that things like this are why we do partial stabilizations, and that probably the harder bits of this shouldn't block the more straightforward bits of this from moving forward. |
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:
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
Unresolved Questions
concat!("\xf0\x9f", "\xa6\x80")
work? (The string literals are not valid UTF-8 individually, but are valid UTF-8 after being concatenated.)The text was updated successfully, but these errors were encountered: