From 3a9981a6d547f4aba0915e3958618358a80ffdea Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Sat, 3 Jan 2026 13:03:25 +0000 Subject: [PATCH] clippy fix: non_canonical_clone_impl (except Infallible) --- library/core/src/clone.rs | 2 +- library/core/src/marker.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 85b09ee06f1fd..f2fa6fd0ca3e9 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -680,7 +680,7 @@ mod impls { #[inline(always)] #[rustc_diagnostic_item = "noop_method_clone"] fn clone(&self) -> Self { - self + *self } } diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 57416455e9de8..43300cc843c6d 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -849,7 +849,7 @@ impl Copy for PhantomData {} #[stable(feature = "rust1", since = "1.0.0")] impl Clone for PhantomData { fn clone(&self) -> Self { - Self + *self } }