//@ run-rustfix #![allow(dead_code)] #[derive(Clone)] struct Wrapper(T); struct OnlyCopyIfDisplay(std::marker::PhantomData); impl Clone for OnlyCopyIfDisplay { fn clone(&self) -> Self { OnlyCopyIfDisplay(std::marker::PhantomData) } } impl Copy for OnlyCopyIfDisplay {} impl Copy for Wrapper> {} //~^ ERROR the trait `Copy` cannot be implemented for this type fn main() {}