]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/missing-bound-in-manual-copy-impl-2.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / missing-bound-in-manual-copy-impl-2.rs
1 // run-rustfix
2
3 #[derive(Clone)]
4 struct Wrapper<T>(T);
5
6 struct OnlyCopyIfDisplay<T>(std::marker::PhantomData<T>);
7
8 impl<T: std::fmt::Display> Clone for OnlyCopyIfDisplay<T> {
9     fn clone(&self) -> Self {
10         OnlyCopyIfDisplay(std::marker::PhantomData)
11     }
12 }
13
14 impl<T: std::fmt::Display> Copy for OnlyCopyIfDisplay<T> {}
15
16 impl<S> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
17 //~^ ERROR the trait `Copy` may not be implemented for this type
18
19 fn main() {}