#![feature(type_alias_impl_trait)]
use std::marker::PhantomData;
type Tait<'a> = impl Sized;
struct Outlives<'a, T: 'a>(PhantomData<&'a ()>, PhantomData<T>);
fn foo<'a, 'b>() -> Tait<'a> {
let _: Outlives::<'b, Tait<'a>> = Outlives(PhantomData, PhantomData);
()
}
this fails with the old solver with
error: lifetime may not live long enough
--> <source>:8:12
|
7 | fn foo<'a, 'b>() -> Tait<'a> {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
8 | let _: Outlives::<'b, Tait<'a>> = Outlives(PhantomData, PhantomData);
| ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'b`
|
= help: consider adding the following bound: `'a: 'b`
this fails with the old solver with