]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / impl-trait / issues / issue-21659-show-relevant-trait-impls-3.rs
1 trait Foo<A> {
2     fn foo(&self, a: A) -> A {
3         a
4     }
5 }
6
7 trait NotRelevant<A> {
8     fn nr(&self, a: A) -> A {
9         a
10     }
11 }
12
13 struct Bar;
14
15 impl NotRelevant<usize> for Bar {}
16
17 fn main() {
18     let f1 = Bar;
19
20     f1.foo(1usize);
21     //~^ error: method named `foo` found for struct `Bar` in the current scope
22 }