rust-clippy/tests/ui/non_canonical_clone_impl.stderr

42 lines
1.3 KiB
Text
Raw Normal View History

error: non-canonical implementation of `clone` on a `Copy` type
2024-02-17 12:16:29 +00:00
--> tests/ui/non_canonical_clone_impl.rs:9:29
2023-06-13 10:25:49 +00:00
|
LL | fn clone(&self) -> Self {
| _____________________________^
LL | | Self(self.0)
LL | | }
| |_____^ help: change this to: `{ *self }`
|
= 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
error: unnecessary implementation of `clone_from` on a `Copy` type
2024-02-17 12:16:29 +00:00
--> tests/ui/non_canonical_clone_impl.rs:13: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: non-canonical implementation of `clone` on a `Copy` type
2024-02-17 12:16:29 +00:00
--> tests/ui/non_canonical_clone_impl.rs:80:29
2023-06-13 10:25:49 +00:00
|
LL | fn clone(&self) -> Self {
| _____________________________^
LL | | Self(self.0)
LL | | }
| |_____^ help: change this to: `{ *self }`
error: unnecessary implementation of `clone_from` on a `Copy` type
2024-02-17 12:16:29 +00:00
--> tests/ui/non_canonical_clone_impl.rs:84: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