diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 1c37a6b2aca..de6210d1893 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -796,6 +796,7 @@ options, or, or_patterns, + os_string_type, other, out, overlapping_marker_traits, @@ -824,6 +825,7 @@ pat2018, pat2021, path, + path_buf_type, pattern_parentheses, phantom_data, pin, @@ -1084,6 +1086,7 @@ slice, slice_alloc, slice_patterns, + slice_to_vec_method, slice_u8, slice_u8_alloc, slicing_syntax, @@ -1159,6 +1162,7 @@ then_with, thread, thread_local, + to_owned_trait, tool_attributes, tool_lints, trace_macros, diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs index adf996fc782..2fa349e3a4f 100644 --- a/library/alloc/src/borrow.rs +++ b/library/alloc/src/borrow.rs @@ -32,6 +32,7 @@ fn borrow(&self) -> &B { /// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data /// from any borrow of a given type. #[stable(feature = "rust1", since = "1.0.0")] +#[cfg_attr(not(test), rustc_diagnostic_item = "to_owned_trait")] pub trait ToOwned { /// The resulting type after obtaining ownership. #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index cb015b94930..f8cc6a45877 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -442,6 +442,7 @@ macro_rules! sort_by_key { /// // Here, `s` and `x` can be modified independently. /// ``` #[rustc_conversion_suggestion] + #[rustc_diagnostic_item = "slice_to_vec_method"] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn to_vec(&self) -> Vec diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index c9c8f68cd9c..c1629d8b8f9 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -71,6 +71,7 @@ /// [`CStr`]: crate::ffi::CStr /// [conversions]: super#conversions #[derive(Clone)] +#[cfg_attr(not(test), rustc_diagnostic_item = "os_string_type")] #[stable(feature = "rust1", since = "1.0.0")] pub struct OsString { inner: Buf, diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 1889e549338..66135a719be 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1066,6 +1066,7 @@ impl FusedIterator for Ancestors<'_> {} /// /// Which method works best depends on what kind of situation you're in. #[derive(Clone)] +#[cfg_attr(not(test), rustc_diagnostic_item = "path_buf_type")] #[stable(feature = "rust1", since = "1.0.0")] // FIXME: // `PathBuf::as_mut_vec` current implementation relies