<p dir="auto">Right now no unboxed closures are Copy, but there's no reason that 0-size closures or those with only copy captures couldn't be Copy.</p>
<h3 dir="auto">Description:</h3>
<p dir="auto">Internal compiler error with the following code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pub trait Trait {}

impl PartialEq for Trait {
    fn eq(&amp;self, other: &amp;Self) -&gt; bool {
        self as *const _ == other as *const _
    }
}"><pre class="notranslate"><span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Trait</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

<span class="pl-k">impl</span> <span class="pl-smi">PartialEq</span> <span class="pl-k">for</span> <span class="pl-smi">Trait</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">eq</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">self</span><span class="pl-kos">,</span> <span class="pl-s1">other</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Self</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">bool</span> <span class="pl-kos">{</span>
        <span class="pl-smi">self</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-smi">_</span> == other <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-smi">_</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Version:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="λ → rustc --version --verbose
rustc 1.2.0-nightly (2f5683913 2015-06-18)
binary: rustc
commit-hash: 2f5683913c9815d9f12494784747f79b0f3b3066
commit-date: 2015-06-18
host: x86_64-apple-darwin
release: 1.2.0-nightly"><pre class="notranslate"><code class="notranslate">λ → rustc --version --verbose
rustc 1.2.0-nightly (2f5683913 2015-06-18)
binary: rustc
commit-hash: 2f5683913c9815d9f12494784747f79b0f3b3066
commit-date: 2015-06-18
host: x86_64-apple-darwin
release: 1.2.0-nightly
</code></pre></div>
<h3 dir="auto">Backtrace:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/trans/datum.rs:635

stack backtrace:
   1:        0x10692f625 - sys::backtrace::write::h7217b77d522d376bzns
   2:        0x1069388c6 - panicking::on_panic::h734ff7875f002408HHw
   3:        0x1068eeff8 - rt::unwind::begin_unwind_inner::h12ac9fe1c7c1af05Tpw
   4:        0x102dec3ff - rt::unwind::begin_unwind::h9456661013370349045
   5:        0x102e84628 - trans::datum::Datum&lt;'tcx, K&gt;::to_llscalarish::h2090742821809817825
   6:        0x102f0c3d7 - trans::expr::trans_binary::h18b1ae4d157c7559UOC
   7:        0x102f0041a - trans::expr::trans_unadjusted::hb8364de9ecf82122hiB
   8:        0x102ed7a4c - trans::expr::trans_into::h37bf0f4f595d93d16DA
   9:        0x102e54d10 - trans::controlflow::trans_block::h4fbfe9e245dfbc46Ruv
  10:        0x102e5363a - trans::base::trans_closure::h34071d9a784d8f1cLWh
  11:        0x102e5533e - trans::base::trans_fn::h8b60fc728b696b76t7h
  12:        0x102e5914c - trans::base::trans_item::haac7f69fe6a753f8Yvi
  13:        0x102e66cfb - trans::base::trans_crate::hb1800db125dfa8773jj
  14:        0x102cbb42f - driver::phase_4_translate_to_llvm::ha90b5a4585d4395fBOa
  15:        0x102c93f4f - driver::compile_input::hc7efa8e10e996fb1Tba
  16:        0x102d56449 - run_compiler::hd964f53796cdaa72G7b
  17:        0x102d5393f - boxed::F.FnBox&lt;A&gt;::call_box::h1390611659955526416
  18:        0x102d53087 - rt::unwind::try::try_fn::h7096656292409969094
  19:        0x1069c8db8 - rust_try_inner
  20:        0x1069c8da5 - rust_try
  21:        0x106921075 - rt::unwind::try::inner_try::had4cdff9eafcbf1fMlw
  22:        0x102d532d2 - boxed::F.FnBox&lt;A&gt;::call_box::h7809183391410762880
  23:        0x10693729d - sys::thread::Thread::new::thread_start::hd1c42fff9d20c3856Jv
  24:     0x7fff95422267 - _pthread_body
  25:     0x7fff954221e4 - _pthread_start"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/trans/datum.rs:635

stack backtrace:
   1:        0x10692f625 - sys::backtrace::write::h7217b77d522d376bzns
   2:        0x1069388c6 - panicking::on_panic::h734ff7875f002408HHw
   3:        0x1068eeff8 - rt::unwind::begin_unwind_inner::h12ac9fe1c7c1af05Tpw
   4:        0x102dec3ff - rt::unwind::begin_unwind::h9456661013370349045
   5:        0x102e84628 - trans::datum::Datum&lt;'tcx, K&gt;::to_llscalarish::h2090742821809817825
   6:        0x102f0c3d7 - trans::expr::trans_binary::h18b1ae4d157c7559UOC
   7:        0x102f0041a - trans::expr::trans_unadjusted::hb8364de9ecf82122hiB
   8:        0x102ed7a4c - trans::expr::trans_into::h37bf0f4f595d93d16DA
   9:        0x102e54d10 - trans::controlflow::trans_block::h4fbfe9e245dfbc46Ruv
  10:        0x102e5363a - trans::base::trans_closure::h34071d9a784d8f1cLWh
  11:        0x102e5533e - trans::base::trans_fn::h8b60fc728b696b76t7h
  12:        0x102e5914c - trans::base::trans_item::haac7f69fe6a753f8Yvi
  13:        0x102e66cfb - trans::base::trans_crate::hb1800db125dfa8773jj
  14:        0x102cbb42f - driver::phase_4_translate_to_llvm::ha90b5a4585d4395fBOa
  15:        0x102c93f4f - driver::compile_input::hc7efa8e10e996fb1Tba
  16:        0x102d56449 - run_compiler::hd964f53796cdaa72G7b
  17:        0x102d5393f - boxed::F.FnBox&lt;A&gt;::call_box::h1390611659955526416
  18:        0x102d53087 - rt::unwind::try::try_fn::h7096656292409969094
  19:        0x1069c8db8 - rust_try_inner
  20:        0x1069c8da5 - rust_try
  21:        0x106921075 - rt::unwind::try::inner_try::had4cdff9eafcbf1fMlw
  22:        0x102d532d2 - boxed::F.FnBox&lt;A&gt;::call_box::h7809183391410762880
  23:        0x10693729d - sys::thread::Thread::new::thread_start::hd1c42fff9d20c3856Jv
  24:     0x7fff95422267 - _pthread_body
  25:     0x7fff954221e4 - _pthread_start
</code></pre></div>