1
Fork 0

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]
This commit is contained in:
Andrea Nall 2021-02-15 02:27:20 +00:00
parent b86674e7cc
commit 5ef202520f
5 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,7 @@ where
/// 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")]

View file

@ -442,6 +442,7 @@ impl<T> [T] {
/// // 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<T>