Stabilize str::from_utf8_unchecked as const
This commit is contained in:
parent
72868e017b
commit
fe7487a79e
1 changed files with 1 additions and 1 deletions
|
|
@ -156,7 +156,7 @@ pub fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
|
|||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")]
|
||||
#[rustc_const_stable(feature = "const_str_from_utf8_unchecked", since = "1.55.0")]
|
||||
#[rustc_allow_const_fn_unstable(const_fn_transmute)]
|
||||
pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
|
||||
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue