fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
474 B19 linesraw
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() {}