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
|
2022-12-24 17:17:25 -06:00
|
|
|
//~| expected signature `fn(&mut Baz, &mut dyn Foo)`
|
|
|
|
//~| found signature `fn(&mut Baz, &dyn Foo)`
|
2014-08-17 18:29:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|