Skip to content

Split up diagnostics in uncommon_codepoints (potentially splitting up the lint as well) #120228

Open
@Manishearth

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:

  1. 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.
  2. One that talks about Technical in general
  3. One that talks about Exclusion in general (this is "scripts that are dead")
  4. One that talks about Limited_Use in general (this is "scripts that are alive but not in widespread digital use yet")
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-UnicodeArea: UnicodeA-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.E-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.L-uncommon_codepointsLint: uncommon_codepoints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions