Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unused)]
- fn main() {
- use std::pin::Pin;
- fn swap_pins<T>(x: Pin<&mut T>, y: Pin<&mut T>) {
- // `mem::swap` needs `&mut T`, but we cannot get it.
- // We are stuck, we cannot swap the contents of these references.
- // We could use `Pin::get_unchecked_mut`, but that is unsafe for a reason:
- // we are not allowed to use it for moving things out of the `Pin`.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement