]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-normalize-in-where-clause-list.rs
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / regions / regions-normalize-in-where-clause-list.rs
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 ()
9 where
10     'a: 'b,
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>()
18 where
19     <() as Project<'a, 'b>>::Item: Eq,
20 {
21 }
22
23 // Here we get an error: we need `'a: 'b`.
24 fn bar<'a, 'b>()
25 //~^ ERROR cannot infer
26 where
27     <() as Project<'a, 'b>>::Item: Eq,
28 {
29 }
30
31 fn main() {}