mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
32 lines
448 B
Rust
32 lines
448 B
Rust
#[derive(Default, PartialEq)]
|
|
struct Foo<T> {
|
|
bar: Box<[T]>,
|
|
}
|
|
|
|
trait Bar {
|
|
fn foo(&self) {}
|
|
}
|
|
|
|
impl<T: Default + Bar> Bar for Foo<T> {}
|
|
|
|
impl<T> Foo<T> {
|
|
fn bar(&self) {
|
|
self.foo();
|
|
//~^ ERROR the method
|
|
}
|
|
}
|
|
|
|
struct Fin<T> where T: Bar {
|
|
bar: Box<[T]>,
|
|
}
|
|
|
|
impl<T: Default + Bar> Bar for Fin<T> {}
|
|
|
|
impl<T: Bar> Fin<T> {
|
|
fn bar(&self) {
|
|
self.foo();
|
|
//~^ ERROR the method
|
|
}
|
|
}
|
|
fn main() {}
|