-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Undeprecate and update bytes! macro. #18702
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
Conversation
Also note that the problems found by @SimonSapin in #13955 have been fixed. |
How does this expansion differ from |
@SimonSapin: I don't know if it differs from &[...]. I just changed the existing code from static to const. #13955 has been fixed in #18504 |
Which is not confusing at all. rust will just use the exact representation found in the source code file (which already has to be UTF8.) The problem you described in #13955 was about \xHH which is indeed confusing because it behaves differently in other languages. \uHHHH translating to the UTF8 representation is the expected behavior which you can also find in other languages. |
E.g. #include <stdio.h>
#include <string.h>
int main(void) {
printf("%zu\n", strlen("ä"));
printf("%zu\n", strlen("\u00FF"));
printf("%zu\n", strlen("\xFF"));
}
|
This is about #13955, so I responded there. |
Given that this undeprecates something that was deprecated by a prior RFC, I'd like some more opinions on this. @cmr, in the original RFC you seemed to think that bytestrings did not warrant deprecation of |
Note that the previous RFC did not deprecate bytes!. This is only mentioned in the unresolved questions. |
@bstrie I still think it's valuable. |
As modifications to the prelude require an RFC, I'm going to close this for that requirement and out of inactivity. While it is true that byte string literals did not obsolete this macro entirely, this is one of the main reasons we will be developing the syntax extension interface after 1.0 so a semi-niche macro such as this can live outside of the compiler. |
minor: Use a record struct instead of a tuple for each namespace in `PerNs`
See rust-lang/rfcs#69 (comment) and the following for a discussion.
This will now expand to