<p dir="auto">There is another bug by the same name, but that one was fixed. After searching about 10 minutes, I couldn't find any duplicates.</p>
<p dir="auto">The code</p>
<pre class="notranslate">fn main () {
    let arr: ~[u8] = ~[ 1, 2, 3 ];
    let iter = &amp;arr.iter() as &amp;Iterator&lt;&amp;u8&gt;
}
</pre>
<p dir="auto">Fails to compile with the following error</p>
<pre class="notranslate">task 'rustc' failed at 'index out of bounds: the len is 1 but the index is 1', /home/username/dload/code/rust/src/librustc/middle/ty.rs:1432
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '' failed at 'explicit failure', /home/username/dload/code/rust/src/librustc/lib.rs:398
</pre>
<p dir="auto">I am running rustc 0.9-pre (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/e5f4904fab93e33c4cbf71f478dcf8f24bc7c667/hovercard" href="https://github.com/rust-lang/rust/commit/e5f4904fab93e33c4cbf71f478dcf8f24bc7c667"><tt>e5f4904</tt></a> 2013-12-13 07:51:42 -0800) on Fedora 19 (Linux 3.11.6-200.fc19.x86_64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="227519" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/1" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/1/hovercard" href="https://github.com/rust-lang/rust/issues/1">#1</a> SMP). This is latest git HEAD as of about an hour ago.</p>
<p dir="auto">I get a huge performance regression since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="17672890" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/8328" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/8328/hovercard" href="https://github.com/rust-lang/rust/pull/8328">#8328</a> landed (revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2/hovercard" href="https://github.com/rust-lang/rust/commit/a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2"><tt>a8c3fe4</tt></a>) on all my projects. Things are 50 to 75% slower. I’m pretty sure <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="17672890" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/8328" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/8328/hovercard" href="https://github.com/rust-lang/rust/pull/8328">#8328</a> is in cause since when I revert the compiler to the version right before (revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/67c954e365970e4c2cd06f0c50724656d7010f45/hovercard" href="https://github.com/rust-lang/rust/commit/67c954e365970e4c2cd06f0c50724656d7010f45"><tt>67c954e</tt></a>) performances go back to normal.</p>
<p dir="auto">For what it’s worth, the <a href="https://github.com/sebcrozet/nphysics">concerned projects</a> are 100% generic, and rely a lot on cross-crate inlining. They do a lot of numeric computations and array indexing. Sorry if I am a bit vague but I cannot valgrind my projects because my valgrind started to segfault a few days ago (perhaps since the re-enabling of jemalloc)…</p>
<p dir="auto">I tried to come up with a small bench exhibiting the problem. It is not <em>that</em> significative, but the following shows some noticeable performances regression already:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="extern mod extra;

use std::hashmap;
use extra::test::BenchHarness;

#[bench]
fn bench_insert_std(bh: &amp;mut BenchHarness) {
    let mut m = hashmap::HashMap::with_capacity(32);

    do bh.iter {
        for i in range(0u, 500) {
            m.insert((i, i), i);
        }
    }
}

#[bench]
fn bench_insert_find_remove_std(bh: &amp;mut BenchHarness) {
    let mut m = hashmap::HashMap::with_capacity(32);

    do bh.iter {
        for i in range(0u, 200) {
            m.insert((i, i), i);
        }

        for i in range(0u, 200) {
            assert!(*m.find(&amp;(i, i)).unwrap() == i)
        }

        for i in range(100u, 200) {
            m.remove(&amp;(i, i));
        }

        for i in range(100u, 200) {
            assert!(m.find(&amp;(i, i)).is_none())
        }

        for i in range(0u, 100) {
            m.insert((i, i), i * 2);
        }

        for i in range(0u, 100) {
            assert!(*m.find(&amp;(i, i)).unwrap() == i * 2)
        }

        for i in range(0u, 100) {
            m.remove(&amp;(i, i));
        }

        for i in range(0u, 100) {
            assert!(m.find(&amp;(i, i)).is_none())
        }
    }
}

fn main() {
} "><pre class="notranslate"><span class="pl-k">extern</span> <span class="pl-k">mod</span> extra<span class="pl-kos">;</span>

<span class="pl-k">use</span> std<span class="pl-kos">::</span>hashmap<span class="pl-kos">;</span>
<span class="pl-k">use</span> extra<span class="pl-kos">::</span>test<span class="pl-kos">::</span><span class="pl-v">BenchHarness</span><span class="pl-kos">;</span>

<span class="pl-c1">#<span class="pl-kos">[</span>bench<span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">bench_insert_std</span><span class="pl-kos">(</span><span class="pl-s1">bh</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">BenchHarness</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> m = hashmap<span class="pl-kos">::</span><span class="pl-smi">HashMap</span><span class="pl-kos">::</span><span class="pl-en">with_capacity</span><span class="pl-kos">(</span><span class="pl-c1">32</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    do bh<span class="pl-kos">.</span><span class="pl-c1">iter</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">500</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            m<span class="pl-kos">.</span><span class="pl-en">insert</span><span class="pl-kos">(</span><span class="pl-kos">(</span>i<span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">,</span> i<span class="pl-kos">)</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>bench<span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">bench_insert_find_remove_std</span><span class="pl-kos">(</span><span class="pl-s1">bh</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">BenchHarness</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-k">mut</span> m = hashmap<span class="pl-kos">::</span><span class="pl-smi">HashMap</span><span class="pl-kos">::</span><span class="pl-en">with_capacity</span><span class="pl-kos">(</span><span class="pl-c1">32</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    do bh<span class="pl-kos">.</span><span class="pl-c1">iter</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">200</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            m<span class="pl-kos">.</span><span class="pl-en">insert</span><span class="pl-kos">(</span><span class="pl-kos">(</span>i<span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">200</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>*m.find<span class="pl-kos">(</span>&amp;<span class="pl-kos">(</span>i, i<span class="pl-kos">)</span><span class="pl-kos">)</span>.unwrap<span class="pl-kos">(</span><span class="pl-kos">)</span> == i<span class="pl-kos">)</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">100</span>u<span class="pl-kos">,</span> <span class="pl-c1">200</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            m<span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-kos">(</span>i<span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">100</span>u<span class="pl-kos">,</span> <span class="pl-c1">200</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>m.find<span class="pl-kos">(</span>&amp;<span class="pl-kos">(</span>i, i<span class="pl-kos">)</span><span class="pl-kos">)</span>.is_none<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            m<span class="pl-kos">.</span><span class="pl-en">insert</span><span class="pl-kos">(</span><span class="pl-kos">(</span>i<span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">,</span> i <span class="pl-c1">*</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-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>*m.find<span class="pl-kos">(</span>&amp;<span class="pl-kos">(</span>i, i<span class="pl-kos">)</span><span class="pl-kos">)</span>.unwrap<span class="pl-kos">(</span><span class="pl-kos">)</span> == i * <span class="pl-c1">2</span><span class="pl-kos">)</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            m<span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-kos">(</span>i<span class="pl-kos">,</span> i<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-en">range</span><span class="pl-kos">(</span><span class="pl-c1">0</span>u<span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>m.find<span class="pl-kos">(</span>&amp;<span class="pl-kos">(</span>i, i<span class="pl-kos">)</span><span class="pl-kos">)</span>.is_none<span class="pl-kos">(</span><span class="pl-kos">)</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-kos">}</span> </pre></div>
<p dir="auto">Compiled with <code class="notranslate">--opt-level=3</code>.<br>
With the (new) compiler <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2/hovercard" href="https://github.com/rust-lang/rust/commit/a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2"><tt>a8c3fe4</tt></a>, I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test bench_insert_find_remove_std ... bench: 89242 ns/iter (+/- 3605)
test bench_insert_std ... bench: 46177 ns/iter (+/- 1555)"><pre class="notranslate"><code class="notranslate">test bench_insert_find_remove_std ... bench: 89242 ns/iter (+/- 3605)
test bench_insert_std ... bench: 46177 ns/iter (+/- 1555)
</code></pre></div>
<p dir="auto">With the (old) compiler <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/67c954e365970e4c2cd06f0c50724656d7010f45/hovercard" href="https://github.com/rust-lang/rust/commit/67c954e365970e4c2cd06f0c50724656d7010f45"><tt>67c954e</tt></a>, I get something more than 10% faster. The asm dump is smaller too:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test bench_insert_find_remove_std ... bench: 73939 ns/iter (+/- 2872)
test bench_insert_std ... bench: 38482 ns/iter (+/- 1005)"><pre class="notranslate"><code class="notranslate">test bench_insert_find_remove_std ... bench: 73939 ns/iter (+/- 2872)
test bench_insert_std ... bench: 38482 ns/iter (+/- 1005)
</code></pre></div>