]> git.proxmox.com Git - rustc.git/blob - tests/ui/issues/issue-22684.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 }