2018-09-21 18:26:24 -05:00
|
|
|
#![feature(nll)]
|
|
|
|
|
|
|
|
// Test that we are able to establish that `<T as
|
|
|
|
// MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says
|
|
|
|
// so).
|
|
|
|
//
|
2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be 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() {}
|