2023-09-08 13:15:51 +00:00
|
|
|
error: non-canonical implementation of `clone` on a `Copy` type
|
2024-01-23 14:41:26 +00:00
|
|
|
--> tests/ui/non_canonical_clone_impl.rs:10:29
|
2023-06-13 10:25:49 +00:00
|
|
|
|
|
|
|
|
LL | fn clone(&self) -> Self {
|
|
|
|
| _____________________________^
|
|
|
|
LL | | Self(self.0)
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: change this to: `{ *self }`
|
|
|
|
|
|
2023-09-08 13:15:51 +00:00
|
|
|
= note: `-D clippy::non-canonical-clone-impl` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::non_canonical_clone_impl)]`
|
2023-06-13 10:25:49 +00:00
|
|
|
|
2023-09-08 13:15:51 +00:00
|
|
|
error: unnecessary implementation of `clone_from` on a `Copy` type
|
2024-01-23 14:41:26 +00:00
|
|
|
--> tests/ui/non_canonical_clone_impl.rs:14:5
|
2023-06-13 10:25:49 +00:00
|
|
|
|
|
|
|
|
LL | / fn clone_from(&mut self, source: &Self) {
|
|
|
|
LL | | source.clone();
|
|
|
|
LL | | *self = source.clone();
|
|
|
|
LL | | }
|
2023-06-30 20:16:56 +00:00
|
|
|
| |_____^ help: remove it
|
2023-06-13 10:25:49 +00:00
|
|
|
|
2023-09-08 13:15:51 +00:00
|
|
|
error: non-canonical implementation of `clone` on a `Copy` type
|
2024-01-23 14:41:26 +00:00
|
|
|
--> tests/ui/non_canonical_clone_impl.rs:81:29
|
2023-06-13 10:25:49 +00:00
|
|
|
|
|
|
|
|
LL | fn clone(&self) -> Self {
|
|
|
|
| _____________________________^
|
|
|
|
LL | | Self(self.0)
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: change this to: `{ *self }`
|
|
|
|
|
2023-09-08 13:15:51 +00:00
|
|
|
error: unnecessary implementation of `clone_from` on a `Copy` type
|
2024-01-23 14:41:26 +00:00
|
|
|
--> tests/ui/non_canonical_clone_impl.rs:85:5
|
2023-06-13 10:25:49 +00:00
|
|
|
|
|
|
|
|
LL | / fn clone_from(&mut self, source: &Self) {
|
|
|
|
LL | | source.clone();
|
|
|
|
LL | | *self = source.clone();
|
|
|
|
LL | | }
|
2023-06-30 20:16:56 +00:00
|
|
|
| |_____^ help: remove it
|
2023-06-13 10:25:49 +00:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|