<p dir="auto">Both are providing support for static linking and link-time optimization. A 300% increase in size with no increase in scope of the libraries is quite bad. The standard library itself went from 39M to 42M but this can be explained by the added features and some cases of temporarily duplicated code like <code class="notranslate">Vec&lt;T&gt;</code> and <code class="notranslate">~[T]</code>. I have not yet investigated the exact cause of the enormous increase in size.</p>
<p dir="auto">play.rust-lang.org: <a href="http://is.gd/AnPaWL" rel="nofollow">http://is.gd/AnPaWL</a></p>
<p dir="auto">When the same trait is used more than one time but for different concrete types, it triggers the error for duplicate constraints without being sound.</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pub trait Get&lt;T&gt; {
    fn get(&amp;self) -&gt; T;
}

pub struct Foo {
    one: uint,
    two: uint
}

pub struct One(pub uint);
pub struct Two(pub uint);

impl Get&lt;One&gt; for Foo {
    fn get(&amp;self) -&gt; One { One(self.one) }
}

impl Get&lt;Two&gt; for Foo {
    fn get(&amp;self) -&gt; Two { Two(self.two) }
}

// error: trait `Get&lt;Two&gt;` already appears in the list of bounds [E0127]
fn bar&lt;T: Get&lt;One&gt; + Get&lt;Two&gt;&gt;(bar: &amp;T) {
    let One(one) = bar.get();
    println!(&quot;{}&quot;, one);
    let Two(two) = bar.get();
    println!(&quot;{}&quot;, two);
}

fn main() {
    let foo = Foo { one: 1, two: 2 };
    // Works:
    let One(one) = foo.get();
    println!(&quot;{}&quot;, one);
    let Two(two) = foo.get();
    println!(&quot;{}&quot;, two);
    // Does not work:
    bar(&amp;foo);
}"><pre class="notranslate"><span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Get</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">get</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">T</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">Foo</span> <span class="pl-kos">{</span>
    <span class="pl-c1">one</span><span class="pl-kos">:</span> <span class="pl-smi">uint</span><span class="pl-kos">,</span>
    <span class="pl-c1">two</span><span class="pl-kos">:</span> <span class="pl-smi">uint</span>
<span class="pl-kos">}</span>

<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">One</span><span class="pl-kos">(</span><span class="pl-k">pub</span> <span class="pl-smi">uint</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">Two</span><span class="pl-kos">(</span><span class="pl-k">pub</span> <span class="pl-smi">uint</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">impl</span> <span class="pl-smi">Get</span><span class="pl-kos">&lt;</span><span class="pl-smi">One</span><span class="pl-kos">&gt;</span> <span class="pl-k">for</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">get</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">One</span> <span class="pl-kos">{</span> <span class="pl-v">One</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">.</span><span class="pl-c1">one</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">impl</span> <span class="pl-smi">Get</span><span class="pl-kos">&lt;</span><span class="pl-smi">Two</span><span class="pl-kos">&gt;</span> <span class="pl-k">for</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span>
    <span class="pl-k">fn</span> <span class="pl-en">get</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">Two</span> <span class="pl-kos">{</span> <span class="pl-v">Two</span><span class="pl-kos">(</span><span class="pl-smi">self</span><span class="pl-kos">.</span><span class="pl-c1">two</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-c">// error: trait `Get&lt;Two&gt;` already appears in the list of bounds [E0127]</span>
<span class="pl-k">fn</span> <span class="pl-en">bar</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">:</span> <span class="pl-smi">Get</span><span class="pl-kos">&lt;</span><span class="pl-smi">One</span><span class="pl-kos">&gt;</span> + <span class="pl-smi">Get</span><span class="pl-kos">&lt;</span><span class="pl-smi">Two</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">bar</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-v">One</span><span class="pl-kos">(</span>one<span class="pl-kos">)</span> = bar<span class="pl-kos">.</span><span class="pl-en">get</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-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, one<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-v">Two</span><span class="pl-kos">(</span>two<span class="pl-kos">)</span> = bar<span class="pl-kos">.</span><span class="pl-en">get</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-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, two<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> foo = <span class="pl-smi">Foo</span> <span class="pl-kos">{</span> <span class="pl-c1">one</span><span class="pl-kos">:</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">two</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-c">// Works:</span>
    <span class="pl-k">let</span> <span class="pl-v">One</span><span class="pl-kos">(</span>one<span class="pl-kos">)</span> = foo<span class="pl-kos">.</span><span class="pl-en">get</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-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, one<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-v">Two</span><span class="pl-kos">(</span>two<span class="pl-kos">)</span> = foo<span class="pl-kos">.</span><span class="pl-en">get</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-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, two<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-c">// Does not work:</span>
    <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span>foo<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>