about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorAndrea Nall <anall@andreanall.com>2021-02-15 02:27:20 +0000
committerAndrea Nall <anall@andreanall.com>2021-02-15 02:27:28 +0000
commit5ef202520f9c4c87dd6218bbfbbf57587e88f8be (patch)
tree400d310d06e6f4463eabb65d08cb2617c2608ba3 /library/alloc
parentb86674e7cc8ac9c846ed5aca84aaefc2d0d12e4a (diff)
downloadrust-5ef202520f9c4c87dd6218bbfbbf57587e88f8be.tar.gz
rust-5ef202520f9c4c87dd6218bbfbbf57587e88f8be.zip
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]
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/src/borrow.rs1
-rw-r--r--library/alloc/src/slice.rs1
2 files changed, 2 insertions, 0 deletions
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 @@ 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")]
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 @@ 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>