]> git.lizzy.rs Git - rust.git/blob - src/test/ui/function-pointer/sized-ret-with-binder.rs
Rollup merge of #105758 - Nilstrieb:typeck-results-mod, r=compiler-errors
[rust.git] / src / test / ui / function-pointer / sized-ret-with-binder.rs
1 // check-pass
2
3 #![feature(unboxed_closures)]
4
5 fn is_fn<T: for<'a> Fn<(&'a (),)>>() {}
6 fn is_fn2<T: for<'a, 'b> Fn<(&'a &'b (),)>>() {}
7
8 struct Outlives<'a, 'b>(std::marker::PhantomData<&'a &'b ()>);
9
10 fn main() {
11     is_fn::<for<'a> fn(&'a ()) -> &'a ()>();
12     is_fn::<for<'a> fn(&'a ()) -> &'a dyn std::fmt::Debug>();
13     is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> Outlives<'a, 'b>>();
14     is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> (&'a (), &'a ())>();
15 }