fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// run-rustfix 2 3#[derive(Clone)] 4struct Wrapper<T>(T); 5 6struct OnlyCopyIfDisplay<T>(std::marker::PhantomData<T>); 7 8impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> { 9 fn clone(&self) -> Self { 10 OnlyCopyIfDisplay(std::marker::PhantomData) 11 } 12} 13 14impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {} 15 16impl<S: std::fmt::Display> Copy for Wrapper<OnlyCopyIfDisplay<S>> {} 17//~^ ERROR the trait `Copy` cannot be implemented for this type 18 19fn main() {}