title: Trying to modify a Vec of futures inside a Rc<RefCell<...>>
body: <p>I try to wait and remove one-by-one future from a <code>Vec</code> of futures. It does not work. I understand why it does not work: <code>Pin</code> is not copyable. But how to correct this error?</p>
  <pre class="lang-rust prettyprint-override"><code>extern crate futures;
  use std::cell::{RefCell};
  use std::rc::Rc;
  use std::pin::Pin;
  use std::future::Future;
  use futures::channel::oneshot::Canceled;
  use futures::executor::block_on;
  use futures::future::select_all;
  
  fn run_queries_body() {
      let _futures: Vec&lt;Pin&lt;Box&lt;dyn Future&lt;Output=Result&lt;(), Canceled&gt;&gt;&gt;&gt;&gt; = Vec::new();
      let futuresRc = Rc::new(RefCell::new(_futures)); // TODO: Cell instead
  
      // This in actual could be called inside another future, so we need Rc&lt;RefCell&lt;...&gt;&gt;
      let mut futures = futuresRc.borrow_mut();
      let f3 = futures.iter().map(|x| *x);
      let (_res, _idx, remaining_futures) = block_on(select_all(f3));
      *futures = remaining_futures;
  }
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>error[E0507]: cannot move out of `*x` which is behind a shared reference
    --&gt; src/lib.rs:16:37
     |
  16 |     let f3 = futures.iter().map(|x| *x);
     |                                     ^^ move occurs because `*x` has type `std::pin::Pin&lt;std::boxed::Box&lt;dyn futures::Future&lt;Output = std::result::Result&lt;(), futures::channel::oneshot::Canceled&gt;&gt;&gt;&gt;`, which does not implement the `Copy` trait
  </code></pre>