SHARE
TWEET

Untitled

a guest Jun 19th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![allow(unused)]
  2. fn main() {
  3. use std::pin::Pin;
  4. fn swap_pins<T>(x: Pin<&mut T>, y: Pin<&mut T>) {
  5.     // `mem::swap` needs `&mut T`, but we cannot get it.
  6.     // We are stuck, we cannot swap the contents of these references.
  7.     // We could use `Pin::get_unchecked_mut`, but that is unsafe for a reason:
  8.     // we are not allowed to use it for moving things out of the `Pin`.
  9. }
  10. }
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