diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-14 19:26:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-14 19:26:15 +0100 |
| commit | 8c77da87d7451f275259c43c89ac3c9c24c1c8c8 (patch) | |
| tree | 89fc15caaf1dd49a2053042c56308385a897e41b /compiler/rustc_parse/src/errors.rs | |
| parent | 9f3786b2b1f3450c796041175f08a7cae7da42f3 (diff) | |
| parent | 176c44c08ed797b5ddea893a0a292a7bee0d8f8c (diff) | |
| download | rust-8c77da87d7451f275259c43c89ac3c9c24c1c8c8.tar.gz rust-8c77da87d7451f275259c43c89ac3c9c24c1c8c8.zip | |
Rollup merge of #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 #89259 (which I'd like to keep open for `const_char_from_u32_unchecked`).
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
