forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#102470 - est31:stabilize_const_char_convert…
…, r=joshtriplett Stabilize const char convert Split out `const_char_from_u32_unchecked` from `const_char_convert` and stabilize the rest, i.e. stabilize the following functions: ```Rust impl char { pub const fn from_u32(self, i: u32) -> Option<char>; pub const fn from_digit(self, num: u32, radix: u32) -> Option<char>; pub const fn to_digit(self, radix: u32) -> Option<u32>; } // Available through core::char and std::char mod char { pub const fn from_u32(i: u32) -> Option<char>; pub const fn from_digit(num: u32, radix: u32) -> Option<char>; } ``` And put the following under the `from_u32_unchecked` const stability gate as it needs `Option::unwrap` which isn't const-stable (yet): ```Rust impl char { pub const unsafe fn from_u32_unchecked(i: u32) -> char; } // Available through core::char and std::char mod char { pub const unsafe fn from_u32_unchecked(i: u32) -> char; } ``` cc the tracking issue rust-lang#89259 (which I'd like to keep open for `const_char_from_u32_unchecked`).
- Loading branch information
Showing
4 changed files
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters