Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0fe5362

Browse files
committedJun 25, 2024
Stabilize const unchecked conversion from u32 to char
1 parent a451b2a commit 0fe5362

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed
 

‎core/src/char/methods.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ impl char {
223223
/// assert_eq!('❤', c);
224224
/// ```
225225
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
226-
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
226+
#[rustc_const_stable(
227+
feature = "const_char_from_u32_unchecked",
228+
since = "CURRENT_RUSTC_VERSION"
229+
)]
227230
#[must_use]
228231
#[inline]
229232
pub const unsafe fn from_u32_unchecked(i: u32) -> char {

‎core/src/char/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub const fn from_u32(i: u32) -> Option<char> {
123123
/// Converts a `u32` to a `char`, ignoring validity. Use [`char::from_u32_unchecked`].
124124
/// instead.
125125
#[stable(feature = "char_from_unchecked", since = "1.5.0")]
126-
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
126+
#[rustc_const_stable(feature = "const_char_from_u32_unchecked", since = "CURRENT_RUSTC_VERSION")]
127127
#[must_use]
128128
#[inline]
129129
pub const unsafe fn from_u32_unchecked(i: u32) -> char {

‎core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
#![feature(const_bigint_helper_methods)]
123123
#![feature(const_black_box)]
124124
#![feature(const_cell_into_inner)]
125-
#![feature(const_char_from_u32_unchecked)]
126125
#![feature(const_eval_select)]
127126
#![feature(const_exact_div)]
128127
#![feature(const_float_bits_conv)]

0 commit comments

Comments
 (0)
Failed to load comments.