Skip to content

XID_Start / XID_Continue might not be quite right #4928

Description

@graydon

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1518.htm

The ISO JTC1/SC22/WG14 (C language) think that possibly UTR#31 didn't quite hit the nail on the head in terms of defining identifier syntax. They have a couple tweaks in mind. Consider following their lead.

Activity

  1. ghost assigned on Feb 14, 2013
  2. catamorphism commented on Aug 19, 2013

    @catamorphism
    Contributor

    Bug triage. Re-nominating to change to milestone 1, well-defined.

  3. graydon commented on Aug 22, 2013

    @graydon
    ContributorAuthor

    accepted for backwards-compatible milestone

  4. emberian commented on Apr 7, 2014

    @emberian
    Contributor

    Non-ascii identifiers are currently feature gated, so this isn't as pressing, but we still need to figure out what to do here. Re-nominating, I don't think this needs to be backcompat.

  5. pnkfelix commented on Apr 10, 2014

    @pnkfelix
    Contributor

    Correct, non-ascii idents are feature-gated. Recategorizing as P-low (and not 1.0).

  6. yongqli commented on Jun 23, 2015

    @yongqli
    Contributor

    I would really like to see Unicode superscripts allowed, as subscripts already are. I would be willing to make a pull request to implement this.

  7. steveklabnik commented on Nov 15, 2016

    @steveklabnik
    Contributor

    Triage: unicode identifiers are still feature gated, no changes.

  8. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    and removed
    A-frontendArea: Compiler frontend (errors, parsing and HIR)
    on Jul 19, 2017
  9. rurban commented on Nov 9, 2017

    @rurban

    XID_Start / XID_Continue has one small bug, and is not enough to get proper unicode identifiers safe. See also http://websec.github.io/unicode-security-guide/
    You need to add mixed script protections (TR39 Restriction levels), normalize them (to NFC or NFKC_Casefold), and maybe disallow confusables.
    A short overview is here: http://perl11.org/blog/unicode-identifiers.html

    bug: U+3164 HANGUL FILLER and U+ffa0 are wrongly specified as ID_Continue. Disallow these.

  10. Centril commented on Oct 29, 2018

    @Centril
    Contributor

    Closing in favor of #55467.

  11. SimonSapin commented on Oct 29, 2018

    @SimonSapin
    Contributor

    @Centril, is this specific issue actually addressed in rust-lang/rfcs#2457 or tracked in #55467? As far as I can tell they specify unmodified XID_Start and XID_Continue.

  12. Centril commented on Oct 29, 2018

    @Centril
    Contributor

    @SimonSapin at least tracked in that issue to consolidate; tho I didn't read the issue description in detail.

  13. SimonSapin commented on Oct 29, 2018

    @SimonSapin
    Contributor

    I’ve added this as a checkbox in Unresolved Questions in #55467

  14. added a commit that references this issue on Mar 30, 2026
  15. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of RustC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-lowLow priorityT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions