Skip to content

Commit 12c15a2

Browse files
committed
Split out from_u32_unchecked from const_char_convert
It relies on the Option::unwrap function which is not const-stable (yet).
1 parent 8a497b7 commit 12c15a2

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

library/core/src/char/convert.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
1818
}
1919

2020
/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
21-
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
2221
#[inline]
2322
#[must_use]
2423
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {

library/core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl char {
183183
/// assert_eq!('❤', c);
184184
/// ```
185185
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
186-
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
186+
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
187187
#[must_use]
188188
#[inline]
189189
pub const unsafe fn from_u32_unchecked(i: u32) -> char {

library/core/src/char/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub const fn from_u32(i: u32) -> Option<char> {
120120
/// Converts a `u32` to a `char`, ignoring validity. Use [`char::from_u32_unchecked`].
121121
/// instead.
122122
#[stable(feature = "char_from_unchecked", since = "1.5.0")]
123-
#[rustc_const_unstable(feature = "const_char_convert", issue = "89259")]
123+
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
124124
#[must_use]
125125
#[inline]
126126
pub const unsafe fn from_u32_unchecked(i: u32) -> char {

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#![feature(const_caller_location)]
106106
#![feature(const_cell_into_inner)]
107107
#![feature(const_char_convert)]
108+
#![feature(const_char_from_u32_unchecked)]
108109
#![feature(const_clone)]
109110
#![feature(const_cmp)]
110111
#![feature(const_discriminant)]

0 commit comments

Comments
 (0)