title: Cannot move out of value which is behind a shared reference when unwrapping
body: <p>This is the code I am trying to execute:</p>
  
  <pre class="lang-rust prettyprint-override"><code>fn my_fn(arg1: &amp;Option&lt;Box&lt;i32&gt;&gt;) -&gt; i32 {
      if arg1.is_none() {
          return 0;
      }
      let integer = arg1.unwrap();
      *integer
  }
  
  fn main() {
      let integer = 42;
      my_fn(&amp;Some(Box::new(integer)));
  }
  </code></pre>
  
  <p>(<a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=851676c975e45fb28359f5f5a863f80e" rel="noreferrer">on the Rust playground</a>)</p>
  
  <p>I get the following error in previous versions of Rust:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0507]: cannot move out of borrowed content
   --&gt; src/main.rs:5:19
    |
  5 |     let integer = arg1.unwrap();
    |                   ^^^^ cannot move out of borrowed content
  </code></pre>
  
  <p>And in more modern versions:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0507]: cannot move out of `*arg1` which is behind a shared reference
   --&gt; src/main.rs:5:19
    |
  5 |     let integer = arg1.unwrap();
    |                   ^^^^
    |                   |
    |                   move occurs because `*arg1` has type `std::option::Option&lt;std::boxed::Box&lt;i32&gt;&gt;`, which does not implement the `Copy` trait
    |                   help: consider borrowing the `Option`'s content: `arg1.as_ref()`
  </code></pre>
  
  <p>I see there is already a lot of documentation about borrow checker issues, but after reading it, I still can't figure out the problem.</p>
  
  <p>Why is this an error and how do I solve it?</p>