Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (23 sloc) 458 Bytes
// Test that when we infer the lifetime to a subset of the fn body, it
// works out.
//
// build-pass (FIXME(62277): could be check-pass?)
trait MyTrait<'a> {
type Output;
}
fn foo1<T>()
where
for<'x> T: MyTrait<'x>,
{
// Here the region `'c` in `<T as MyTrait<'c>>::Output` will be
// inferred to a subset of the fn body.
let x = bar::<T::Output>();
drop(x);
}
fn bar<'a, T>() -> &'a ()
where
T: 'a,
{
&()
}
fn main() {}
You can’t perform that action at this time.