-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rust doesn't support x₁ and x₂ identifiers while C++ does. #3402
Comments
CC @Manishearth |
That's not spec yet, I'm waiting for the new UAX 31 to be out to propose this. (the new source code spec will also be something we should look at) There's similar work we may want to do to support ZW(N)J. |
If someone wants to propose an RFC for this based on the draft UAX 31 spec I'm happy to help them with it, I don't have time to do it myself |
How likely are things to change from the draft before finalization? Is it worth waiting for the UAX31 update to exit draft status? |
Unlikely, I think. |
I don't think an RFC is necessary for this. The non-ascii-idents RFC says that Rust follows the UAX 31 spec. So when the UAX 31 spec is updated, Rust's parser should be updated accordingly. Or am I missing something? |
No, because these are not a part of the default identifier profile specced in UAX 31: they are an additional profile that the spec lists which users of the spec can choose to follow instead. We have to explicitly make that choice. When Unicode releases a new version we are absolutely allowed to update our UAX 31 data without an RFC, but this changes the algorithm we are choosing to use. |
Most C++ compilers supported x₁ and x₂ as valid identifiers since addition of Unicode support: https://godbolt.org/z/zhGzTKjeK
Clang dropped that support in version 14 but it was restored in version 16 when “Mathematical notation profile for default identiers” ( https://www.unicode.org/L2/L2022/22230-math-profile.pdf ) was adopted.
Would it make sense for Rust to adopt it, too?
The text was updated successfully, but these errors were encountered: