<p dir="auto">Given this:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct S;

impl Drop for S {
    fn drop(&amp;mut self) {
        println!(&quot;Dropping S&quot;);
        panic!(&quot;DIE&quot;);
    }
}

struct T;
impl Drop for T {
    fn drop(&amp;mut self) {
        println!(&quot;Dropping T&quot;);
    }
}
fn main() {
    let t = T;
    let s = S;
}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">S</span><span class="pl-kos">;</span>

<span class="pl-k">impl</span> <span class="pl-smi">Drop</span> <span class="pl-k">for</span> <span class="pl-smi">S</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">drop</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"Dropping S"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-en">panic</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"DIE"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">struct</span> <span class="pl-smi">T</span><span class="pl-kos">;</span>
<span class="pl-k">impl</span> <span class="pl-smi">Drop</span> <span class="pl-k">for</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">drop</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"Dropping T"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> t = <span class="pl-v">T</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> s = <span class="pl-v">S</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Dropping S
thread '&lt;main&gt;' panicked at 'DIE', nounwind.rs:6"><pre class="notranslate"><code class="notranslate">Dropping S
thread '&lt;main&gt;' panicked at 'DIE', nounwind.rs:6
</code></pre></div>
<p dir="auto">The <code class="notranslate">drop()</code> call for T is completely skipped, while I would have expected it to be called.</p>
<p dir="auto">The following standalone struct, when compiled, generates the assertion below.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[deriving(PartialEq)]
struct Foo {
  bar:str
}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>deriving<span class="pl-kos">(</span><span class="pl-v">PartialEq</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">struct</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-c1">bar</span><span class="pl-kos">:</span><span class="pl-smi">str</span>
<span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/lib/IR/Instructions.cpp:1086: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)-&gt;getType() == cast&lt;PointerType&gt;(getOperand(1)-&gt;getType())-&gt;getElementType() &amp;&amp; &quot;Ptr must be a pointer to Val type!&quot;' failed."><pre class="notranslate"><code class="notranslate">rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/llvm/lib/IR/Instructions.cpp:1086: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)-&gt;getType() == cast&lt;PointerType&gt;(getOperand(1)-&gt;getType())-&gt;getElementType() &amp;&amp; "Ptr must be a pointer to Val type!"' failed.
</code></pre></div>