File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
167167#[ must_use]
168168#[ stable( feature = "rust1" , since = "1.0.0" ) ]
169169#[ rustc_const_stable( feature = "const_str_from_utf8_unchecked" , since = "1.55.0" ) ]
170+ #[ rustc_diagnostic_item = "str_from_utf8_unchecked" ]
170171pub const unsafe fn from_utf8_unchecked ( v : & [ u8 ] ) -> & str {
171172 // SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
172173 // Also relies on `&str` and `&[u8]` having the same layout.
@@ -194,6 +195,7 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
194195#[ must_use]
195196#[ stable( feature = "str_mut_extras" , since = "1.20.0" ) ]
196197#[ rustc_const_unstable( feature = "const_str_from_utf8_unchecked_mut" , issue = "91005" ) ]
198+ #[ rustc_diagnostic_item = "str_from_utf8_unchecked_mut" ]
197199pub const unsafe fn from_utf8_unchecked_mut ( v : & mut [ u8 ] ) -> & mut str {
198200 // SAFETY: the caller must guarantee that the bytes `v`
199201 // are valid UTF-8, thus the cast to `*mut str` is safe.
You can’t perform that action at this time.
0 commit comments