summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs
blob: 41f48cb56933e3f7434b03741061859d09ad29ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
trait Foo<A> {
    fn foo(&self, a: A) -> A {
        a
    }
}

trait NotRelevant<A> {
    fn nr(&self, a: A) -> A {
        a
    }
}

struct Bar;

impl NotRelevant<usize> for Bar {}

fn main() {
    let f1 = Bar;

    f1.foo(1usize);
    //~^ error: method named `foo` found for struct `Bar` in the current scope
}