First version of noop-lint

This commit is contained in:
Ryan Levick 2021-01-05 10:07:50 +01:00 committed by Ryan Levick
parent cbca5689a5
commit 040735c110
4 changed files with 77 additions and 0 deletions

View file

@ -104,6 +104,7 @@
/// [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.
///
@ -221,6 +222,7 @@ mod impls {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Clone for &T {
#[inline]
#[rustc_diagnostic_item = "ref_clone_method"]
fn clone(&self) -> Self {
*self
}