Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #![feature(async_await)]
  2.  
  3. use std::future::Future;
  4.  
  5. struct S;
  6.  
  7. impl S {
  8. // is there any way to declare that the returned
  9. // (and implicitly constructed) future will not
  10. // hold on to &self in any way?
  11. async fn f(&self) {}
  12.  
  13. fn why(&self) -> impl Future<Output = ()> {
  14. self.f()
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement