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
|
2019-11-13 16:16:56 -06:00
|
|
|
//~| expected fn pointer `fn(&mut Baz, &mut dyn Foo)`
|
|
|
|
//~| found fn pointer `fn(&mut Baz, &dyn Foo)`
|
2014-08-17 18:29:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|