mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
20 lines
229 B
Rust
20 lines
229 B
Rust
|
trait Foo {
|
||
|
type X;
|
||
|
fn method(&self) {}
|
||
|
}
|
||
|
|
||
|
#[derive(Clone)]
|
||
|
struct Bar<T: Foo> {
|
||
|
x: T::X,
|
||
|
}
|
||
|
|
||
|
struct NotClone;
|
||
|
|
||
|
impl Foo for NotClone {
|
||
|
type X = i8;
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
Bar::<NotClone> { x: 1 }.clone(); //~ ERROR
|
||
|
}
|