rust/tests/ui/traits/copy-impl-cannot-normalize.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
345 B
Rust
Raw Normal View History

trait TraitFoo {
type Bar;
}
struct Foo<T>
where
T: TraitFoo,
{
inner: T::Bar,
}
impl<T> Clone for Foo<T>
where
T: TraitFoo,
T::Bar: Clone,
{
fn clone(&self) -> Self {
Self { inner: self.inner.clone() }
}
}
impl<T> Copy for Foo<T> {}
//~^ ERROR the trait bound `T: TraitFoo` is not satisfied
fn main() {}