summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.fixed
blob: 691e7553a0952ef5e1bf8807ffb975130d0056ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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: std::fmt::Display> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
//~^ ERROR the trait `Copy` may not be implemented for this type

fn main() {}