1 trait Foo<A> { foo(&self, a: A) -> A2 fn foo(&self, a: A) -> A { 3 a 4 } 5 } 6 7 trait NotRelevant<A> { nr(&self, a: A) -> A8 fn nr(&self, a: A) -> A { 9 a 10 } 11 } 12 13 struct Bar; 14 15 impl Foo<i32> for Bar {} 16 17 impl Foo<u8> for Bar {} 18 19 impl NotRelevant<usize> for Bar {} 20 main()21fn main() { 22 let f1 = Bar; 23 24 f1.foo(1usize); 25 //~^ error: the trait bound `Bar: Foo<usize>` is not satisfied 26 } 27