SHARE
TWEET

Untitled

a guest Jul 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::pin::Pin;
  2.  
  3. struct Foo;
  4.  
  5. impl std::ops::Deref for Foo {
  6.     type Target = ();
  7.     fn deref(&self) -> &() {
  8.         &()
  9.     }
  10. }
  11.  
  12. impl From<Box<()>> for Pin<Foo> {
  13.     fn from(_: Box<()>) -> Pin<Foo> {
  14.         Pin::new(Foo)
  15.     }
  16. }
  17.  
  18. fn main() {
  19.     let foo = Box::new(());
  20.     let bar = Pin::from(foo);
  21. }
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