2018-09-21 18:26:24 -05:00
|
|
|
// Test that we are able to establish that `<T as
|
|
|
|
// MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says
|
|
|
|
// so).
|
|
|
|
//
|
2020-01-22 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-21 18:26:24 -05:00
|
|
|
|
|
|
|
trait MyTrait<'a> {
|
|
|
|
type Output: 'a;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo<'a, T>() -> &'a ()
|
|
|
|
where
|
|
|
|
T: MyTrait<'a>,
|
|
|
|
{
|
|
|
|
bar::<T::Output>()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bar<'a, T>() -> &'a ()
|
|
|
|
where
|
|
|
|
T: 'a,
|
|
|
|
{
|
|
|
|
&()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|