2017-12-01 04:07:52 -06:00
|
|
|
// Test that we are able to normalize in the list of where-clauses,
|
|
|
|
// even if `'a: 'b` is required.
|
|
|
|
|
|
|
|
trait Project<'a, 'b> {
|
|
|
|
type Item;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, 'b> Project<'a, 'b> for ()
|
2020-07-24 15:59:43 -05:00
|
|
|
where
|
|
|
|
'a: 'b,
|
2017-12-01 04:07:52 -06:00
|
|
|
{
|
|
|
|
type Item = ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// No error here, we have 'a: 'b. We used to report an error here
|
|
|
|
// though, see https://github.com/rust-lang/rust/issues/45937.
|
|
|
|
fn foo<'a: 'b, 'b>()
|
2020-07-24 15:59:43 -05:00
|
|
|
where
|
|
|
|
<() as Project<'a, 'b>>::Item: Eq,
|
2017-12-01 04:07:52 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Here we get an error: we need `'a: 'b`.
|
2020-07-24 15:59:43 -05:00
|
|
|
fn bar<'a, 'b>()
|
|
|
|
//~^ ERROR cannot infer
|
|
|
|
where
|
|
|
|
<() as Project<'a, 'b>>::Item: Eq,
|
2017-12-01 04:07:52 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-07-24 15:59:43 -05:00
|
|
|
fn main() {}
|