Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created March 25, 2023 21:15
Show Gist options
  • Save rust-play/71de1284b6a3966302b1ddf88960e003 to your computer and use it in GitHub Desktop.
Save rust-play/71de1284b6a3966302b1ddf88960e003 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
use core::pin::Pin;
use core::marker::PhantomPinned;
#[derive(Debug)]
struct Unm(i32, PhantomPinned);
fn foo() -> Pin<Box<Unm>> {
Box::pin(Unm(1, PhantomPinned))
}
fn main() {
let mut f = foo();
//let u: &mut Unm = f.as_mut().get_mut();
//Pin::into_inner(f);
dbg![f];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment