@@ -238,6 +238,7 @@ impl str {
238
238
/// assert_eq!("💖", sparkle_heart);
239
239
/// ```
240
240
#[ unstable( feature = "inherent_str_constructors" , issue = "131114" ) ]
241
+ #[ rustc_diagnostic_item = "str_inherent_from_utf8" ]
241
242
pub const fn from_utf8 ( v : & [ u8 ] ) -> Result < & str , Utf8Error > {
242
243
converts:: from_utf8 ( v)
243
244
}
@@ -274,6 +275,7 @@ impl str {
274
275
/// errors that can be returned.
275
276
#[ unstable( feature = "inherent_str_constructors" , issue = "131114" ) ]
276
277
#[ rustc_const_unstable( feature = "const_str_from_utf8" , issue = "91006" ) ]
278
+ #[ rustc_diagnostic_item = "str_inherent_from_utf8_mut" ]
277
279
pub const fn from_utf8_mut ( v : & mut [ u8 ] ) -> Result < & mut str , Utf8Error > {
278
280
converts:: from_utf8_mut ( v)
279
281
}
@@ -306,6 +308,7 @@ impl str {
306
308
#[ inline]
307
309
#[ must_use]
308
310
#[ unstable( feature = "inherent_str_constructors" , issue = "131114" ) ]
311
+ #[ rustc_diagnostic_item = "str_inherent_from_utf8_unchecked" ]
309
312
pub const unsafe fn from_utf8_unchecked ( v : & [ u8 ] ) -> & str {
310
313
// SAFETY: converts::from_utf8_unchecked has the same safety requirements as this function.
311
314
unsafe { converts:: from_utf8_unchecked ( v) }
@@ -331,6 +334,7 @@ impl str {
331
334
#[ inline]
332
335
#[ must_use]
333
336
#[ unstable( feature = "inherent_str_constructors" , issue = "131114" ) ]
337
+ #[ rustc_diagnostic_item = "str_inherent_from_utf8_unchecked_mut" ]
334
338
pub const unsafe fn from_utf8_unchecked_mut ( v : & mut [ u8 ] ) -> & mut str {
335
339
// SAFETY: converts::from_utf8_unchecked_mut has the same safety requirements as this function.
336
340
unsafe { converts:: from_utf8_unchecked_mut ( v) }
0 commit comments