title: How to destructure/move out of Drop implementing type?
body: <p>I have a managed pointer type <code>Uniq</code>, implementing <code>Drop</code>, that has a method that is supposed to consume it without running <code>drop</code> and return a <code>Box</code> of its allocation.</p>
  <pre class="lang-rust prettyprint-override"><code>struct Uniq&lt;T&gt; { data: ManuallyDropped&lt;Box&lt;T&gt;&gt;, metadata: Metadata }
  
  impl Uniq&lt;T&gt; {
     fn into_parts(/* mut */ self) -&gt; (Box&lt;T&gt;, Metadata) {
       (ManuallyDrop::into_inner(self.data), self.metadata) // doesn't work
  
       // let Self { data, metadata } = self; // doesn't work either
     }
  }
  
  impl&lt;T&gt; Drop for Uniq&lt;T&gt; {
    fn drop(&amp;mut self) {
      // fancy_management_ledgerwork(self.metadata)
    }
  }
  
  #[derive(Clone, Copy)]
  struct Metadata(usize);
  </code></pre>
  <p>How do I accomplish this kind of &quot;destructuring move&quot; for my type which implements <code>Drop</code>?</p>
  <p>Note: Literally every search engine result is about people not understanding move semantics. I <em>do</em> understand move semantics and I am trying to exploit them to ensure memory safety and I cannot figure out how. I'd rather not convert the <code>ManuallyDrop&lt;Box&lt;T&gt;&gt;</code> to something less-safe-but-<code>Copy</code> like <code>NonNull&lt;T&gt;</code>.</p>