]>
Commit | Line | Data |
---|---|---|
54a0048b SL |
1 | mod foo { |
2 | pub struct Foo; | |
3 | impl Foo { | |
4 | fn bar(&self) {} | |
5 | } | |
85aaf69f | 6 | |
54a0048b | 7 | pub trait Baz { |
476ff2be | 8 | fn bar(&self) -> bool { true } |
54a0048b SL |
9 | } |
10 | impl Baz for Foo {} | |
11 | } | |
223e47cc | 12 | |
d9579d0f | 13 | fn main() { |
54a0048b SL |
14 | use foo::Baz; |
15 | ||
16 | // Check that `bar` resolves to the trait method, not the inherent impl method. | |
17 | let _: () = foo::Foo.bar(); //~ ERROR mismatched types | |
c34b1796 | 18 | } |