]> git.proxmox.com Git - rustc.git/blobdiff - library/core/src/clone.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / library / core / src / clone.rs
index a953a3a4182bce854c29c7f02a5aceb67ccbf945..51a2dc03de3186668e51f942acd9cd841a0b3017 100644 (file)
 /// [impls]: #implementors
 #[stable(feature = "rust1", since = "1.0.0")]
 #[lang = "clone"]
+#[rustc_diagnostic_item = "Clone"]
 pub trait Clone: Sized {
     /// Returns a copy of the value.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![allow(noop_method_call)]
     /// let hello = "Hello"; // &str implements Clone
     ///
     /// assert_eq!("Hello", hello.clone());
@@ -221,6 +223,7 @@ mod impls {
     #[stable(feature = "rust1", since = "1.0.0")]
     impl<T: ?Sized> Clone for &T {
         #[inline]
+        #[rustc_diagnostic_item = "noop_method_clone"]
         fn clone(&self) -> Self {
             *self
         }