fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// edition: 2021 2// run-rustfix 3 4#![allow(unused)] 5 6use std::future::Future; 7use std::pin::Pin; 8use std::task::{Context, Poll}; 9 10#[derive(Clone)] 11struct SharedFuture; 12 13impl Future for SharedFuture { 14 type Output = (); 15 16 fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<<Self as Future>::Output> { 17 todo!() 18 } 19} 20 21async fn foo() { 22 let f = SharedFuture; 23 f.clone().await; 24 f.await; 25 //~^ ERROR use of moved value 26} 27 28fn main() {}