2014-08-17 18:29:10 -05:00
|
|
|
trait Foo {
|
2019-05-28 13:46:13 -05:00
|
|
|
fn bar(&mut self, other: &mut dyn Foo);
|
2014-08-17 18:29:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz;
|
|
|
|
|
|
|
|
impl Foo for Baz {
|
2019-05-28 13:46:13 -05:00
|
|
|
fn bar(&mut self, other: &dyn Foo) {}
|
2016-07-18 15:13:34 -05:00
|
|
|
//~^ ERROR method `bar` has an incompatible type for trait
|
2018-05-26 22:51:50 -05:00
|
|
|
//~| expected type `fn(&mut Baz, &mut dyn Foo)`
|
|
|
|
//~| found type `fn(&mut Baz, &dyn Foo)`
|
2014-08-17 18:29:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|