RS.CLIPPY.EXPL_IMPL_CLONE_ON_COPY

Implementing `Clone` explicitly on `Copy` types

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: expl_impl_clone_on_copy. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for explicit Clone implementations for Copy types.

Why is this bad?

To avoid surprising behavior, these traits should agree and the behavior of Copy cannot be overridden. In almost all situations a Copy type should have a Clone implementation that does nothing more than copy the object, which is what #[derive(Copy, Clone)] gets you.

Example

#[derive(Copy)]
struct Foo;

impl Clone for Foo {
    // ..
}