daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![feature(async_await, futures_api, trait_alias, unboxed_closures)]
  2.  
  3. use std::future::Future;
  4.  
  5. trait Foo<'a> = FnOnce<(&'a u8,)> where <Self as FnOnce<(&'a u8,)>>::Output: Future<Output = u8> + 'a;
  6.  
  7. fn foo<F>(f: F) where F: for<'a> Foo<'a> {
  8.     let bar = 5;
  9.     f(&bar);
  10. }
  11.  
  12. fn main() {
  13.     // foo(async move | f: &u8 | { *f });
  14.  
  15.     foo({ async fn baz(f: &u8) -> u8 { *f } baz });
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top