Feature gate: #![feature(char_max_len)]
This is a tracking issue for #45795.
Public API
// core::char
impl char {
pub const MAX_LEN_UTF8: usize = 4;
pub const MAX_LEN_UTF16: usize = 2;
}
pub const MAX_LEN_UTF8: usize = char::MAX_LEN_UTF8;
pub const MAX_LEN_UTF16: usize = char::MAX_LEN_UTF16;
Steps / History
Notes for Stabilization
When stabilizing this, the documentation for the char::encode_utf8 function should be
adjusted to include these constants.
Unresolved Questions
Feature gate:
#![feature(char_max_len)]This is a tracking issue for #45795.
Public API
Steps / History
MAX_LEN_UTF8andMAX_LEN_UTF16Constants #120580char_max_len#145610Notes for Stabilization
When stabilizing this, the documentation for the
char::encode_utf8function should beadjusted to include these constants.
Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩