Skip to content

Commit f58a129

Browse files
committed
add diagnostic items
Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
1 parent 97575f0 commit f58a129

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

alloc/src/borrow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ where
3232
/// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data
3333
/// from any borrow of a given type.
3434
#[stable(feature = "rust1", since = "1.0.0")]
35+
#[cfg_attr(not(test), rustc_diagnostic_item = "to_owned_trait")]
3536
pub trait ToOwned {
3637
/// The resulting type after obtaining ownership.
3738
#[stable(feature = "rust1", since = "1.0.0")]

alloc/src/slice.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ impl<T> [T] {
442442
/// // Here, `s` and `x` can be modified independently.
443443
/// ```
444444
#[rustc_conversion_suggestion]
445+
#[rustc_diagnostic_item = "slice_to_vec_method"]
445446
#[stable(feature = "rust1", since = "1.0.0")]
446447
#[inline]
447448
pub fn to_vec(&self) -> Vec<T>

std/src/ffi/os_str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
7171
/// [`CStr`]: crate::ffi::CStr
7272
/// [conversions]: super#conversions
7373
#[derive(Clone)]
74+
#[cfg_attr(not(test), rustc_diagnostic_item = "os_string_type")]
7475
#[stable(feature = "rust1", since = "1.0.0")]
7576
pub struct OsString {
7677
inner: Buf,

std/src/path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ impl FusedIterator for Ancestors<'_> {}
10661066
///
10671067
/// Which method works best depends on what kind of situation you're in.
10681068
#[derive(Clone)]
1069+
#[cfg_attr(not(test), rustc_diagnostic_item = "path_buf_type")]
10691070
#[stable(feature = "rust1", since = "1.0.0")]
10701071
// FIXME:
10711072
// `PathBuf::as_mut_vec` current implementation relies

0 commit comments

Comments
 (0)