Closed
Description
The following program ICE's on the playpen (will update to git HEAD and check there):
fn main() {
for n in [1, 2, 3, 4].iter() {}
}
If you remove the for
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?)
Exact ICE is
anon>:17:18: 17:27 error: internal compiler error: borrow-vec associated with bad sty: &ty_err
<anon>: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<Any>', /build/rust-git/src/rust/src/libsyntax/ast_util.rs:784
Edit: The new for loop changes allow the above program to compile. But you can still access the bug with
fn main() {
let x = [1, 2, 3, 4].iter();
}
which ICEs even with git HEAD. (Above I said "if you remove the for loop it doesn't crash" but evidently I was wrong.)