Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #![feature(async_await, futures_api)]
  2.  
  3. use std::future::Future;
  4.  
  5. fn check<A, B, F, R>(f: F)
  6. where
  7. F: FnOnce(A) -> R,
  8. R: Future<Output = B>,
  9. {}
  10.  
  11. fn main() {
  12. let fut = async move |x: i32| x * x;
  13. check(fut);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement