blob: 104ac4d222ebea682e8d55e097089c0295717bba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// check-pass
#![feature(unboxed_closures)]
fn is_fn<T: for<'a> Fn<(&'a (),)>>() {}
fn is_fn2<T: for<'a, 'b> Fn<(&'a &'b (),)>>() {}
struct Outlives<'a, 'b>(std::marker::PhantomData<&'a &'b ()>);
fn main() {
is_fn::<for<'a> fn(&'a ()) -> &'a ()>();
is_fn::<for<'a> fn(&'a ()) -> &'a dyn std::fmt::Debug>();
is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> Outlives<'a, 'b>>();
is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> (&'a (), &'a ())>();
}
|