]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-22684.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / issues / issue-22684.rs
1 mod foo {
2     pub struct Foo;
3     impl Foo {
4         fn bar(&self) {}
5     }
6
7     pub trait Baz {
8         fn bar(&self) -> bool { true }
9     }
10     impl Baz for Foo {}
11 }
12
13 fn main() {
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
18 }