]>
Commit | Line | Data |
---|---|---|
ff7c6d11 XL |
1 | // Test that we are able to normalize in the list of where-clauses, |
2 | // even if `'a: 'b` is required. | |
3 | ||
4 | trait Project<'a, 'b> { | |
5 | type Item; | |
6 | } | |
7 | ||
8 | impl<'a, 'b> Project<'a, 'b> for () | |
29967ef6 XL |
9 | where |
10 | 'a: 'b, | |
ff7c6d11 XL |
11 | { |
12 | type Item = (); | |
13 | } | |
14 | ||
15 | // No error here, we have 'a: 'b. We used to report an error here | |
16 | // though, see https://github.com/rust-lang/rust/issues/45937. | |
17 | fn foo<'a: 'b, 'b>() | |
29967ef6 XL |
18 | where |
19 | <() as Project<'a, 'b>>::Item: Eq, | |
ff7c6d11 XL |
20 | { |
21 | } | |
22 | ||
23 | // Here we get an error: we need `'a: 'b`. | |
29967ef6 XL |
24 | fn bar<'a, 'b>() |
25 | //~^ ERROR cannot infer | |
29967ef6 XL |
26 | where |
27 | <() as Project<'a, 'b>>::Item: Eq, | |
ff7c6d11 XL |
28 | { |
29 | } | |
30 | ||
29967ef6 | 31 | fn main() {} |