rust/tests/ui/non_canonical_clone_impl.stderr

42 lines
1.3 KiB
Plaintext
Raw Normal View History

error: non-canonical implementation of `clone` on a `Copy` type
--> tests/ui/non_canonical_clone_impl.rs:11:29
2023-06-13 05:25:49 -05: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 05:25:49 -05:00
error: unnecessary implementation of `clone_from` on a `Copy` type
--> tests/ui/non_canonical_clone_impl.rs:15:5
2023-06-13 05:25:49 -05:00
|
LL | / fn clone_from(&mut self, source: &Self) {
LL | | source.clone();
LL | | *self = source.clone();
LL | | }
2023-06-30 15:16:56 -05:00
| |_____^ help: remove it
2023-06-13 05:25:49 -05:00
error: non-canonical implementation of `clone` on a `Copy` type
--> tests/ui/non_canonical_clone_impl.rs:82:29
2023-06-13 05:25:49 -05: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
--> tests/ui/non_canonical_clone_impl.rs:86:5
2023-06-13 05:25:49 -05:00
|
LL | / fn clone_from(&mut self, source: &Self) {
LL | | source.clone();
LL | | *self = source.clone();
LL | | }
2023-06-30 15:16:56 -05:00
| |_____^ help: remove it
2023-06-13 05:25:49 -05:00
error: aborting due to 4 previous errors