Closed
Description
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