]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Test that an impl with only one bound region `'a` cannot be used to |
2 | // satisfy a constraint where there are two bound regions. | |
3 | ||
4 | trait Foo<X> { | |
5 | fn foo(&self, x: X) { } | |
6 | } | |
7 | ||
8 | fn want_foo2<T>() | |
9 | where T : for<'a,'b> Foo<(&'a isize, &'b isize)> | |
10 | { | |
11 | } | |
12 | ||
13 | fn want_foo1<T>() | |
14 | where T : for<'z> Foo<(&'z isize, &'z isize)> | |
15 | { | |
16 | } | |
17 | ||
1a4d82fc JJ |
18 | // Expressed as a where clause |
19 | ||
20 | struct SomeStruct; | |
21 | ||
22 | impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct | |
23 | { | |
24 | } | |
25 | ||
26 | fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region | |
923072b8 FG |
27 | fn b() { want_foo2::<SomeStruct>(); } |
28 | //~^ ERROR implementation of | |
29 | //~| ERROR implementation of | |
1a4d82fc JJ |
30 | |
31 | fn main() { } |