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