Skip to content

Tracking Issue for #![feature(char_is_xid)] #164841

Open

Description

@sleepycatcoding

Feature gate: #![feature(char_is_xid)]

This is a tracking issue for methods to check if a character belongs in an identifier as defined by Unicode XID sets.

Public API

// core::char::methods

impl char {
    pub fn is_xid_continue(self) -> bool;
    pub fn is_xid_start(self) -> bool;
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    on Oct 24, 2026
  2. sleepycatcoding commented on Oct 24, 2026

    @sleepycatcoding
    ContributorAuthor

    @rustbot label -S-tracking-unimplemented

  3. sleepycatcoding commented on Oct 24, 2026

    @sleepycatcoding
    ContributorAuthor

    @rustbot label +S-tracking-needs-to-bake

  4. added a commit that references this issue on Oct 24, 2026
  5. added 2 commits that reference this issue on Oct 24, 2026
  6. added a commit that references this issue on Oct 24, 2026
  7. fmease commented on Oct 25, 2026

    @fmease
    Member

    It's obviously the plan to eventually use char::is_xid_{start,continue} in rustc, right? This would mean every time char::is_xid_*s' or rather std's Unicode version got upgraded, T-lang would need to FCP it unless T-lang started delegating that decision (CC #148321 (comment) whose status I don't know). Just something of note.

    In any case, this can't really be (fully) done today since rustc_lexer has to compile on stable (at least under cfg not(feature = "nightly")) since it's used by rust-analyzer which must compile on stable.

    Moreover, char::is_xid_* on nightly probably follows char::UNICODE_VERSION which is Unicode 18.0.0 at the time of writing. However, the Unicode standard used for Rust, the language, is currently Unicode 17.0.0.

  8. hanna-kruppe commented on Oct 25, 2026

    @hanna-kruppe
    Contributor

    Good point. I guess we could technically keep the standard library's unicode version separate from the the unicode version used for Rust syntax. Coupling them is required to fully achieve the ACP's original motivation of matching Rust identifier syntax, but keeping them separate is no worse (in practice likely better) than the current practice of everyone depending on third party libraries and occasionally bumping that dependency. But yes, it would be nicer if we could eventually remove this distinction.

    For comparison, the Java spec does not specify the exact Unicode version used for its lexical syntax and instead delegates to its standard library.

  9. Jules-Bertholet commented on Oct 28, 2026

    @Jules-Bertholet
    Contributor

    With rust-lang/rfcs#3840, do we want methods for ID_Compat_Math_Start/ID_Compat_Math_Continue?

  10. tgross35 commented on Oct 28, 2026

    @tgross35
    Member

    13. For comparison, the Java spec does not specify the exact Unicode version used for its lexical syntax and instead delegates to its standard library.

    I think this could be a reasonable thing for us to do as well. A quick grep for common methods show that we're at least using the Unicode classifiers is_alphabetic, is_alphanumeric, is_control, is_digit, is_numeric, is_whitespace, split_whitespace, and others in the compiler. Not all are technically user-facing, but many are in some way. It would be significantly easier and better for compiler contributors to adapt the Java approach and say this is okay, also meaning the new is_xid_start/is_xid_continue can be used, than to need to purge all of these from the compiler and maintain a duplicate set of tables somewhere.

    Also the crate currently used for identifiers in the compiler isn't part of the rust-lang organization anyway https://docs.rs/unicode-ident/latest/unicode_ident/index.html.

  11. tgross35 commented on Oct 28, 2026

    @tgross35
    Member

    With rust-lang/rfcs#3840, do we want methods for ID_Compat_Math_Start/ID_Compat_Math_Continue?

    I think this could be fine to ACP regardless of the RFC. Both those and is_xid_* can be useful for programming language parsers, and exposing unicode tables is pretty easy (aside from core size).

  12. tgross35 commented on Nov 2, 2026

    @tgross35
    Member

    Regarding the above, rust-lang/reference#2403

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-UnicodeArea: UnicodeC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions