Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement