]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/copy-impl-cannot-normalize.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / traits / copy-impl-cannot-normalize.rs
1 trait TraitFoo {
2     type Bar;
3 }
4
5 struct Foo<T>
6 where
7     T: TraitFoo,
8 {
9     inner: T::Bar,
10 }
11
12 impl<T> Clone for Foo<T>
13 where
14     T: TraitFoo,
15     T::Bar: Clone,
16 {
17     fn clone(&self) -> Self {
18         Self { inner: self.inner.clone() }
19     }
20 }
21
22 impl<T> Copy for Foo<T> {}
23 //~^ ERROR the trait bound `T: TraitFoo` is not satisfied
24
25 fn main() {}