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> {
167
167
#[ must_use]
168
168
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
169
169
#[ rustc_const_stable( feature = "const_str_from_utf8_unchecked" , since = "1.55.0" ) ]
170
+ #[ rustc_diagnostic_item = "str_from_utf8_unchecked" ]
170
171
pub const unsafe fn from_utf8_unchecked ( v : & [ u8 ] ) -> & str {
171
172
// SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8.
172
173
// Also relies on `&str` and `&[u8]` having the same layout.
@@ -194,6 +195,7 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
194
195
#[ must_use]
195
196
#[ stable( feature = "str_mut_extras" , since = "1.20.0" ) ]
196
197
#[ rustc_const_unstable( feature = "const_str_from_utf8_unchecked_mut" , issue = "91005" ) ]
198
+ #[ rustc_diagnostic_item = "str_from_utf8_unchecked_mut" ]
197
199
pub const unsafe fn from_utf8_unchecked_mut ( v : & mut [ u8 ] ) -> & mut str {
198
200
// SAFETY: the caller must guarantee that the bytes `v`
199
201
// are valid UTF-8, thus the cast to `*mut str` is safe.
You can’t perform that action at this time.
0 commit comments