mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
26 lines
337 B
Rust
26 lines
337 B
Rust
// Test that we are able to establish that `<T as
|
|
// MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says
|
|
// so).
|
|
//
|
|
//@ check-pass
|
|
|
|
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() {}
|