<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(gdb) bt
#0  0x00007ffff7727630 in rust_fail ()
   from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#1  0x00007ffff75cbd39 in rt::unwind::Unwinder::begin_unwind::h3b1cb9a3eb8d991bXOaD::v0.10.pre () from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#2  0x00007ffff2dd6aa8 in rt::unwind::begin_unwind::hd9a1d253d4a33d5aaQ::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#3  0x00007ffff3976efb in option::Option::unwrap::h144931b46c7e68dblhaV::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#4  0x00007ffff3869351 in metadata::creader::CrateLoader$Loader::load_crate::he9aa556ffd45c033OYae::v0.10.pre ()
   from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#5  0x00007ffff62db6ab in ext::expand::load_extern_macros::h9b911bdebace7cc7aw::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#6  0x00007ffff62db384 in ext::expand::expand_view_item::hf01392e46aef41d3an::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#7  0x00007ffff62c9434 in ext::expand::Folder$MacroExpander::fold_view_item::hc549b12bf2909253TxaX::v0.10.pre ()
   from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#8  0x00007ffff62c93c8 in fold::noop_fold_mod::anon::expr_fn::aVaW ()
   from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#9  0x00007ffff62c98d6 in iter::Map::do_map::hcd7f6781e31a9c951za2::v0.10.pre
    () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#10 0x00007ffff62c9818 in iter::Iterator$Map::next::h9083bbf0fab46094r6a1::v0.10"><pre class="notranslate"><code class="notranslate">(gdb) bt
#0  0x00007ffff7727630 in rust_fail ()
   from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#1  0x00007ffff75cbd39 in rt::unwind::Unwinder::begin_unwind::h3b1cb9a3eb8d991bXOaD::v0.10.pre () from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#2  0x00007ffff2dd6aa8 in rt::unwind::begin_unwind::hd9a1d253d4a33d5aaQ::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#3  0x00007ffff3976efb in option::Option::unwrap::h144931b46c7e68dblhaV::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#4  0x00007ffff3869351 in metadata::creader::CrateLoader$Loader::load_crate::he9aa556ffd45c033OYae::v0.10.pre ()
   from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#5  0x00007ffff62db6ab in ext::expand::load_extern_macros::h9b911bdebace7cc7aw::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#6  0x00007ffff62db384 in ext::expand::expand_view_item::hf01392e46aef41d3an::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#7  0x00007ffff62c9434 in ext::expand::Folder$MacroExpander::fold_view_item::hc549b12bf2909253TxaX::v0.10.pre ()
   from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#8  0x00007ffff62c93c8 in fold::noop_fold_mod::anon::expr_fn::aVaW ()
   from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#9  0x00007ffff62c98d6 in iter::Map::do_map::hcd7f6781e31a9c951za2::v0.10.pre
    () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#10 0x00007ffff62c9818 in iter::Iterator$Map::next::h9083bbf0fab46094r6a1::v0.10
</code></pre></div>
<h2 dir="auto">Updated Bug Report</h2>
<p dir="auto">We do not provide enough user feedback explaining why a type is non-copyable.  The error messages just say "error: copying a value of non-copyable type <code class="notranslate">Type</code>"</p>
<p dir="auto">Things have gotten a bit better since this bug was filed, in part because our story has changed somewhat (we no longer implicitly copy vectors/strings; we no longer have <code class="notranslate">@fn</code>), but we still do not have great user feedback, particularly with respect to explaining <em>how</em> a type ended up being put into the "non-copyable" bucket.</p>
<h2 dir="auto">Sample Code Enumerating Non-copyable Cases</h2>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Issue 2634
// Better explanations for why non-implicitly copyable things are that way.

use NC = std::util::NonCopyable;
use NonCopyExamples::*;

mod NonCopyExamples {
    use NC = std::util::NonCopyable;
    enum Void {}

    pub struct S        { a: int, nc: NC }
    pub struct T        { a: int, own: ~int }
    pub struct U&lt;'self&gt; { a: int, mu: &amp;'self mut int }
    pub struct V        { a: int }
    impl Drop for V { fn drop(&amp;mut self) { } }
    pub struct W&lt;'self&gt; { a: int, fun: &amp;'self fn () }
    pub struct X        { a: int, oyvey: Option&lt;Void&gt; } // (strcat: maybe bug)
}

static mut global_u : int = 3;

fn fun() { println(&quot;Hello World&quot;); }

fn construct() -&gt; (S,T,U,V,W,X) {
    let s = S{ a: 1, nc: NC };
    let t = T{ a: 2, own: ~2 };
    let u = unsafe { U{ a: 3, mu: &amp;mut global_u } };
    let v = V{ a: 4 };
    let w = W{ a: 5, fun: fun };
    let x = X{ a: 6, oyvey: None };
    (s,t,u,v,w,x)
}

fn g&lt;A&gt;(a: A) { println!(&quot;{:?}&quot;, a); }

#[cfg(not(no_funcall_twice))]
fn funcall_twice() {
    use NonCopyExamples::*;

    let (s,t,u,v,w,x) = construct();

    g(s); g(s);
    g(t); g(t);
    g(u); g(u);
    g(v); g(v);
    g(w); g(w);
    g(x); g(x);
}
#[cfg(no_funcall_twice)] fn funcall_twice() { }

#[cfg(not(no_assign))]
fn assign() {
    use NonCopyExamples::*;

    let (s,t,u,v,w,x) = construct();

    let s_1 = s; let s_2 = s;
    let t_1 = t; let t_2 = t;
    let u_1 = u; let u_2 = u;
    let v_1 = v; let v_2 = v;
    let w_1 = w; let w_2 = w;
    let x_1 = x; let x_2 = x;
}
#[cfg(no_assign)] fn assign() { }

#[cfg(not(no_repeat))]
fn repeat() {
    use NonCopyExamples::*;

    let (s,t,u,v,w,x) = construct();

    let ss = [s, ..2];
    let tt = [t, ..2];
    let uu = [u, ..2];
    let vv = [v, ..2];
    let ww = [w, ..2];
    let xx = [x, ..2];
}
#[cfg(no_repeat)] fn repeat() { }

fn main() {
    funcall_twice();
    assign();
    repeat();
}
"><pre class="notranslate"><span class="pl-c">// Issue 2634</span>
<span class="pl-c">// Better explanations for why non-implicitly copyable things are that way.</span>

<span class="pl-k">use</span> <span class="pl-v">NC</span> = std<span class="pl-kos">::</span>util<span class="pl-kos">::</span><span class="pl-v">NonCopyable</span><span class="pl-kos">;</span>
<span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>

<span class="pl-k">mod</span> <span class="pl-v">NonCopyExamples</span> <span class="pl-kos">{</span>
    <span class="pl-k">use</span> <span class="pl-v">NC</span> = std<span class="pl-kos">::</span>util<span class="pl-kos">::</span><span class="pl-v">NonCopyable</span><span class="pl-kos">;</span>
    <span class="pl-k">enum</span> <span class="pl-smi">Void</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">S</span>        <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">nc</span><span class="pl-kos">:</span> <span class="pl-smi">NC</span> <span class="pl-kos">}</span>
    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">T</span>        <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">own</span><span class="pl-kos">:</span> ~<span class="pl-smi">int</span> <span class="pl-kos">}</span>
    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">U</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">self</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">mu</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">self</span> <span class="pl-k">mut</span> <span class="pl-smi">int</span> <span class="pl-kos">}</span>
    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">V</span>        <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</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">V</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-kos">}</span> <span class="pl-kos">}</span>
    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">W</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">self</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">fun</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">self</span> <span class="pl-k">fn</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
    <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">X</span>        <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">oyvey</span><span class="pl-kos">:</span> <span class="pl-smi">Option</span><span class="pl-kos">&lt;</span><span class="pl-smi">Void</span><span class="pl-kos">&gt;</span> <span class="pl-kos">}</span> <span class="pl-c">// (strcat: maybe bug)</span>
<span class="pl-kos">}</span>

<span class="pl-k">static</span> <span class="pl-k">mut</span> global_u <span class="pl-kos">:</span> <span class="pl-smi">int</span> = <span class="pl-c1">3</span><span class="pl-kos">;</span>

<span class="pl-k">fn</span> <span class="pl-en">fun</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-kos">(</span><span class="pl-s">"Hello World"</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">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span> -&gt; <span class="pl-kos">(</span><span class="pl-smi">S</span><span class="pl-kos">,</span><span class="pl-smi">T</span><span class="pl-kos">,</span><span class="pl-smi">U</span><span class="pl-kos">,</span><span class="pl-smi">V</span><span class="pl-kos">,</span><span class="pl-smi">W</span><span class="pl-kos">,</span><span class="pl-smi">X</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> s = <span class="pl-smi">S</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">nc</span><span class="pl-kos">:</span> <span class="pl-v">NC</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> t = <span class="pl-smi">T</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">own</span><span class="pl-kos">:</span> ~<span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> u = <span class="pl-k">unsafe</span> <span class="pl-kos">{</span> <span class="pl-smi">U</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">mu</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> global_u <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> v = <span class="pl-smi">V</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">4</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> w = <span class="pl-smi">W</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">fun</span><span class="pl-kos">:</span> fun <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> x = <span class="pl-smi">X</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">oyvey</span><span class="pl-kos">:</span> <span class="pl-v">None</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">g</span><span class="pl-kos">&lt;</span><span class="pl-smi">A</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">:</span> <span class="pl-smi">A</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">"{:?}"</span>, a<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_funcall_twice<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>

    <span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-en">g</span><span class="pl-kos">(</span>s<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>s<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">g</span><span class="pl-kos">(</span>t<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>t<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">g</span><span class="pl-kos">(</span>u<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>u<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">g</span><span class="pl-kos">(</span>v<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>v<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">g</span><span class="pl-kos">(</span>w<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>w<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">g</span><span class="pl-kos">(</span>x<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>x<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_funcall_twice<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_assign<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>

    <span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">let</span> s_1 = s<span class="pl-kos">;</span> <span class="pl-k">let</span> s_2 = s<span class="pl-kos">;</span>
    <span class="pl-k">let</span> t_1 = t<span class="pl-kos">;</span> <span class="pl-k">let</span> t_2 = t<span class="pl-kos">;</span>
    <span class="pl-k">let</span> u_1 = u<span class="pl-kos">;</span> <span class="pl-k">let</span> u_2 = u<span class="pl-kos">;</span>
    <span class="pl-k">let</span> v_1 = v<span class="pl-kos">;</span> <span class="pl-k">let</span> v_2 = v<span class="pl-kos">;</span>
    <span class="pl-k">let</span> w_1 = w<span class="pl-kos">;</span> <span class="pl-k">let</span> w_2 = w<span class="pl-kos">;</span>
    <span class="pl-k">let</span> x_1 = x<span class="pl-kos">;</span> <span class="pl-k">let</span> x_2 = x<span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_assign<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>

<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_repeat<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>

    <span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">let</span> ss = <span class="pl-kos">[</span>s<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> tt = <span class="pl-kos">[</span>t<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> uu = <span class="pl-kos">[</span>u<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> vv = <span class="pl-kos">[</span>v<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> ww = <span class="pl-kos">[</span>w<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> xx = <span class="pl-kos">[</span>x<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_repeat<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">repeat</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-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h2 dir="auto">Original Bug Report follows</h2>
<p dir="auto">I think the error messages would be clearer if they were along these lines:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo.rs:10: warning: copying a value of type '~str' requires memory allocation
foo.rs:10: note: suggest use of 'move' to avoid this copy
foo.rs:20: warning: copying a value of type `BlockContext` duplicates mutable fields
foo.rs:20: note: use 'copy' if the copy is desired
foo.rs:30: warning: call to 'f' might copy values of type '~str', incurring memory allocation
foo.rs:30: note: see 'copy' interface bound here
foo.rs:40: warning: call to 'g' might copy values of type '~BlockContext', incurring memory allocation and duplicating mutable fields
foo.rs:40: note: see 'copy' interface bound here"><pre class="notranslate"><code class="notranslate">foo.rs:10: warning: copying a value of type '~str' requires memory allocation
foo.rs:10: note: suggest use of 'move' to avoid this copy
foo.rs:20: warning: copying a value of type `BlockContext` duplicates mutable fields
foo.rs:20: note: use 'copy' if the copy is desired
foo.rs:30: warning: call to 'f' might copy values of type '~str', incurring memory allocation
foo.rs:30: note: see 'copy' interface bound here
foo.rs:40: warning: call to 'g' might copy values of type '~BlockContext', incurring memory allocation and duplicating mutable fields
foo.rs:40: note: see 'copy' interface bound here
</code></pre></div>