#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::pin::Pin; use std::task::Context; use std::future::Future; fn move_pinned_closure(mut x: impl Future, cx: &mut Context<'_>) { let mut closure = move || unsafe { let _ignore = Pin::new_unchecked(&mut x).poll(cx); }; closure(); let mut moved = closure; moved(); } fn main() {}