title: How do I get an owned value out of a `Box`?
body: <p>What is the implementation for this function:</p>
  
  <pre><code>fn unbox&lt;T&gt;(value: Box&lt;T&gt;) -&gt; T {
      // ???
  }
  </code></pre>
  
  <p>The only function in the documentation that looks like what I want is <code>Box::into_raw</code>. The following will type check:</p>
  
  <pre><code>fn unbox&lt;T&gt;(value: Box&lt;T&gt;) -&gt; T {
      *value.into_raw()
  }
  </code></pre>
  
  <p>This gives the error <code>error[E0133]: dereference of raw pointer requires unsafe function or block</code>. Wrapping it in an <code>unsafe { ... }</code> block fixes it.</p>
  
  <pre><code>fn unbox&lt;T&gt;(value: Box&lt;T&gt;) -&gt; T {
      unsafe { *value.into_raw() }
  }
  </code></pre>
  
  <p>Is this the correct implementation? If so, why is it unsafe? What does it mean?</p>
  
  <p>Perhaps this question shows my general uncertainty of how <code>Box</code>s actually work.</p>