<p dir="auto">The following program ICE's on the playpen (will update to git HEAD and check there):</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
  for n in [1, 2, 3, 4].iter() {}
}"><pre class="notranslate"><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">for</span> n <span class="pl-k">in</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</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-en">iter</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></pre></div>
<p dir="auto">If you remove the <code class="notranslate">for</code> loop it is better, it will say "please add a suffix to 1" or something like that. (Maybe this was fixed by the recent changes in the for loop implementation?)</p>
<p dir="auto">Exact ICE is</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="anon&gt;:17:18: 17:27 error: internal compiler error: borrow-vec associated with bad sty: &amp;ty_err
&lt;anon&gt;:17         for n in [1, 2, 3].iter() { }
                           ^~~~~~~~~
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/ast_util.rs:784"><pre class="notranslate"><code class="notranslate">anon&gt;:17:18: 17:27 error: internal compiler error: borrow-vec associated with bad sty: &amp;ty_err
&lt;anon&gt;:17         for n in [1, 2, 3].iter() { }
                           ^~~~~~~~~
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/ast_util.rs:784
</code></pre></div>
<p dir="auto"><b>Edit:</b> The new for loop changes allow the above program to compile. But you can still access the bug with</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
  let x = [1, 2, 3, 4].iter();
}"><pre class="notranslate"><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> x = <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</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-en">iter</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">which ICEs even with git HEAD. (Above I said "if you remove the for loop it doesn't crash" but evidently I was wrong.)</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
    let v = &amp;[];
    let it = v.iter();
}"><pre class="notranslate"><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> v = <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> it = v<span class="pl-kos">.</span><span class="pl-en">iter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="vec-ice.rs:3:13: 3:14 error: internal compiler error: borrow-vec associated with bad sty: &amp;ty_err
vec-ice.rs:3     let it = v.iter();
                          ^"><pre class="notranslate"><code class="notranslate">vec-ice.rs:3:13: 3:14 error: internal compiler error: borrow-vec associated with bad sty: &amp;ty_err
vec-ice.rs:3     let it = v.iter();
                          ^
</code></pre></div>
<p dir="auto">(Doesn't happen with <code class="notranslate">.slice</code>.)</p>