Split up diagnostics in uncommon_codepoints (potentially splitting up the lint as well) #120228
Description
Currently we have the uncommon_codepoints
lint, which lints on anything which is Identifier_Status=Restricted
.
It may be worth improving the diagnostics there by splitting it into multiple different specialized diagnostics. In the long run, some of these might be something that should be promoted to a separate lint so that they can individually be allowed.
The diagnostics I can think of are:
- One that calls out confusables with operators and syntax. we already have this for parse errors but not for lints post-parse. Unicode does not provide this data directly but we can construct it from unicode data easily.
- One that talks about Technical in general
- One that talks about Exclusion in general (this is "scripts that are dead")
- One that talks about Limited_Use in general (this is "scripts that are alive but not in widespread digital use yet")
- One that talks about Not_NFKC in general.
The first one can be implemented by taking the set of Rust syntax characters, expanding that to their confusables set, and then winnowing it down to the set of characters that is allowed in an identifier. This could belong in a separate check in the unicode-security crate.
The others can be implemented by checking the identifier_type()
of characters in the ident.
I might be able to mentor this, I can provide diagnostic text for these when needed.
Activity