Skip to content

Commit 9462d92

Browse files
committed
make encode_utf8_raw_unchecked const-stable
1 parent 3a60212 commit 9462d92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/char/methods.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1817,8 +1817,10 @@ pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
18171817
///
18181818
/// For a safe version of this function, see the [`encode_utf8_raw`] function.
18191819
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
1820+
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "CURRENT_RUSTC_VERSION")]
18201821
#[doc(hidden)]
18211822
#[inline]
1823+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
18221824
pub const unsafe fn encode_utf8_raw_unchecked(code: u32, dst: *mut u8) {
18231825
let len = len_utf8(code);
18241826
// SAFETY: The caller must guarantee that the buffer pointed to by `dst`

0 commit comments

Comments
 (0)