Stabilize const unchecked conversion from u32 to char
This commit is contained in:
parent
d929a42a66
commit
9d3c79bcd0
@ -223,7 +223,10 @@ pub const fn from_u32(i: u32) -> Option<char> {
|
|||||||
/// assert_eq!('❤', c);
|
/// assert_eq!('❤', c);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
|
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
|
||||||
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
|
#[rustc_const_stable(
|
||||||
|
feature = "const_char_from_u32_unchecked",
|
||||||
|
since = "CURRENT_RUSTC_VERSION"
|
||||||
|
)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
|
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
|
||||||
|
@ -123,7 +123,7 @@ pub const fn from_u32(i: u32) -> Option<char> {
|
|||||||
/// Converts a `u32` to a `char`, ignoring validity. Use [`char::from_u32_unchecked`].
|
/// Converts a `u32` to a `char`, ignoring validity. Use [`char::from_u32_unchecked`].
|
||||||
/// instead.
|
/// instead.
|
||||||
#[stable(feature = "char_from_unchecked", since = "1.5.0")]
|
#[stable(feature = "char_from_unchecked", since = "1.5.0")]
|
||||||
#[rustc_const_unstable(feature = "const_char_from_u32_unchecked", issue = "89259")]
|
#[rustc_const_stable(feature = "const_char_from_u32_unchecked", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
|
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
|
||||||
|
@ -122,7 +122,6 @@
|
|||||||
#![feature(const_bigint_helper_methods)]
|
#![feature(const_bigint_helper_methods)]
|
||||||
#![feature(const_black_box)]
|
#![feature(const_black_box)]
|
||||||
#![feature(const_cell_into_inner)]
|
#![feature(const_cell_into_inner)]
|
||||||
#![feature(const_char_from_u32_unchecked)]
|
|
||||||
#![feature(const_eval_select)]
|
#![feature(const_eval_select)]
|
||||||
#![feature(const_exact_div)]
|
#![feature(const_exact_div)]
|
||||||
#![feature(const_float_bits_conv)]
|
#![feature(const_float_bits_conv)]
|
||||||
|
Loading…
Reference in New Issue
Block a user