Closed
Description
This example code:
let ๐ข๐๐๐๐๐๐๐๐ข = 1;
Produced a useless conversion suggestion:
warning: variable `๐ข๐๐๐๐๐๐๐๐ข` should have a snake case name
--> src/main.rs:4:9
|
4 | let ๐ข๐๐๐๐๐๐๐๐ข = 1;
| ^^^^^^^^^ help: convert the identifier to snake case: `๐ข๐๐๐๐๐๐๐๐ข`
|
= note: `#[warn(non_snake_case)]` on by default
The problem here is that while these characters are in the Uppercase Letter (Lu) general category, they do not have a proper lowercase mapping: the lowercase of ๐ is still ๐, not ๐ช (thus Rust cannot suggest ๐ผ๐ท๐ช๐ช๐ช๐ช๐ด๐ฎ๐ผ
).
This is the same for the other direction:
warning: type `๐๐ ๐ฅ_๐_๐๐๐๐๐` should have an upper camel case name
--> src/lib.rs:3:8
|
3 | struct ๐๐ ๐ฅ_๐_๐๐๐๐๐;
| ^^^^^^^^^^^ help: convert the identifier to upper camel case: `๐๐ ๐ฅ๐๐๐๐๐๐`
|
= note: `#[warn(non_camel_case_types)]` on by default
It shouldn't produce the suggestion at all if the conversion result is not changed, but I'm not sure about cases involving adding or removing underscores.
Meta
rustc on playground, 1.48.0-nightly (2020-09-26 623fb90).
Metadata
Metadata
Assignees
Labels
Area: UnicodeArea: Messages for errors, warnings, and lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Suggestions generated by the compiler applied by `cargo fix`Category: This is a bug.Diagnostics: A structured suggestion resulting in incorrect code.`#![feature(non_ascii_idents)]`Relevant to the compiler team, which will review and decide on the PR/issue.