]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-75777.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-75777.rs
1 // Regression test for #75777.
2 // Checks that a boxed future can be properly constructed.
3
4 use std::future::{self, Future};
5 use std::pin::Pin;
6
7 type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + 'a + Send>>;
8
9 fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
10     let fut: BoxFuture<'a, A> = Box::pin(future::ready(v));
11     Box::new(move |_| fut)
12     //~^ ERROR: cannot infer an appropriate lifetime
13 }
14
15 fn main() {}