2022-07-25 20:37:06 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#[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> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
|
2023-03-07 17:55:51 -06:00
|
|
|
//~^ ERROR the trait `Copy` cannot be implemented for this type
|
2022-07-25 20:37:06 -05:00
|
|
|
|
|
|
|
fn main() {}
|