-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 Emojis for variable names #18982
Comments
Sadly, at this time Rust only intends to support the subset of emotions that can be derived from UAX 31, and only then by employing a feature flag. You'll have to put some effort into your emoji, I'm afraid. For example: #![feature(non_ascii_idents)]
#![allow(non_snake_case)] // ㅋㅋㅋㅋ
fn main() {
ಠ_ಠ();
}
fn ಠ_ಠ() {
println!("Hello, 世界");
} Post 1.0 I expect that we can consider expanding the definition of what is permitted within Unicode identifiers, though it would have to proceed through the RFC process. |
Related RFC for those getting here through Google: #55467. |
I am of the opinion that this issue should be reopened in light of the RFC being stabilized. As the friendly C++ folks noted on their report about adopting UAX #31 for C++:
The same 💩 emoji is rejected by rust precisely due to UAX-31, and arguably it makes stuff less fun than what Swift allows :Q (On the other hand, it does render the point about emoji width calculation on the RFC moot!) |
I don't see the issue with emoji or any unicode identifiers. It's just a code point after all. |
Extract variable assist triggers less eagerly
Rust currently doesn't support emojis for variable names. Is there any plans to include this feature?
The text was updated successfully, but these errors were encountered: