Skip to content

Tracking issue for UnicodeVersion and UNICODE_VERSION #49726

Closed
@SimonSapin

Description

@SimonSapin

std::char contains the following items:

/// The version of [Unicode](http://www.unicode.org/) that the Unicode parts of
/// `char` and `str` methods are based on.
pub const UNICODE_VERSION: UnicodeVersion = UnicodeVersion {
    major: 10,
    minor: 0,
    micro: 0,
    _priv: (),
};

/// Represents a Unicode Version.
///
/// See also: <http://www.unicode.org/versions/>
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct UnicodeVersion {
    /// Major version.
    pub major: u32,

    /// Minor version.
    pub minor: u32,

    /// Micro (or Update) version.
    pub micro: u32,

    // Private field to keep struct expandable.
    pub(crate) _priv: (),
}

The value of the constant can change as new versions of the standard library are updated to new versions of Unicode.

They have been unstable under the unicode feature with #27783 as the designated tracking issue since they’ve been added in #18002 and #42998. We should decide whether to stabilize them (possibly with changes) or deprecate and remove them.

I think it is important to have this information part of the standard library documentation somehow. I don’t know how useful it is to access this information programmatically.

CC @rust-lang/libs, @behnam

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UnicodeArea: UnicodeB-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API 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