]>
Commit | Line | Data |
---|---|---|
ff7c6d11 XL |
1 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | // Test that we are able to normalize in the list of where-clauses, | |
12 | // even if `'a: 'b` is required. | |
13 | ||
14 | trait Project<'a, 'b> { | |
15 | type Item; | |
16 | } | |
17 | ||
18 | impl<'a, 'b> Project<'a, 'b> for () | |
19 | where 'a: 'b | |
20 | { | |
21 | type Item = (); | |
22 | } | |
23 | ||
24 | // No error here, we have 'a: 'b. We used to report an error here | |
25 | // though, see https://github.com/rust-lang/rust/issues/45937. | |
26 | fn foo<'a: 'b, 'b>() | |
27 | where <() as Project<'a, 'b>>::Item : Eq | |
28 | { | |
29 | } | |
30 | ||
31 | // Here we get an error: we need `'a: 'b`. | |
32 | fn bar<'a, 'b>() //~ ERROR cannot infer | |
33 | where <() as Project<'a, 'b>>::Item : Eq | |
34 | { | |
35 | } | |
36 | ||
37 | fn main() { } |