title: async function: the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, Client>`
body: <p>I reached a strange error while using recursion inside an async.</p>
  <p>I can use <code>client</code> inside the <code>async</code>. However, if I call <code>do_something</code> again it complains about <code>std::sync::MutexGuard&lt;'_, Client&gt;</code> not being send. I think it's trying to send <code>c</code> to another thread. I thought <code>do_something</code> executed in a thread, and <code>do_something(client.clone()).await</code> in another. I don't see why <code>c</code> is moving from the <code>async</code> thread to this new thread.</p>
  <pre><code>use std::sync::{Arc, Mutex};
  use std::future::Future;
  use futures::future::{BoxFuture, FutureExt};
  
  struct Client{
  }
  
  impl Client {}
  
  fn do_something&lt;'a&gt;(
          client: Arc&lt;Mutex&lt;Client&gt;&gt;,
  ) -&gt; BoxFuture&lt;'a, std::result::Result&lt;(), ()&gt;&gt; {
      async move {
          let c = client.lock().unwrap();
          do_something(client.clone()).await;
          Ok(())
      }.boxed()
  }
  
  fn main() {
      let c = Arc::new(Mutex::new(Client{}));
      do_something(c.clone());
  }
  </code></pre>
  <p>Error:</p>
  <pre><code>error: future cannot be sent between threads safely
    --&gt; src/main.rs:17:7
     |
  17 |     }.boxed()
     |       ^^^^^ future created by async block is not `Send`
     |
     = help: within `impl futures::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard&lt;'_, Client&gt;`
  note: future is not `Send` as this value is used across an await
    --&gt; src/main.rs:15:9
     |
  14 |         let c = client.lock().unwrap();
     |             - has type `std::sync::MutexGuard&lt;'_, Client&gt;` which is not `Send`
  15 |         do_something(client.clone()).await;
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here, with `c` maybe used later
  16 |         Ok(())
  17 |     }.boxed()
     |     - `c` is later dropped here
  </code></pre>
  <p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=95ca0998613bb48e4e035f69eef1b6fe" rel="noreferrer">Playground</a></p>