]>
Commit | Line | Data |
---|---|---|
9cc50fc6 SL |
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 Foo<i8> for Bar {} | |
16 | impl Foo<i16> for Bar {} | |
17 | impl Foo<i32> for Bar {} | |
18 | ||
19 | impl Foo<u8> for Bar {} | |
20 | impl Foo<u16> for Bar {} | |
21 | impl Foo<u32> for Bar {} | |
22 | ||
23 | impl NotRelevant<usize> for Bar {} | |
24 | ||
25 | fn main() { | |
26 | let f1 = Bar; | |
27 | ||
28 | f1.foo(1usize); | |
54a0048b | 29 | //~^ error: the trait bound `Bar: Foo<usize>` is not satisfied |
9cc50fc6 | 30 | } |