Closed
Description
Calling vec::each incorrectly causes a compiler internal error. Compiling this code
fn main(s: [str]) {
let a = [];
vec::each(a) { |x|
}
}
with rust 851fde8 gives this error:
bug.rs:4:17: 6:5 error: in function anon, not all control paths return a value
bug.rs:4 vec::each(a) { |x|
bug.rs:5
bug.rs:6 }
rust: upcall fail 'print_type shouldn't see a ty_infer', ../src/librustsyntax/print/pprust.rs:384
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', ../src/rustc/driver/rustc.rs:182
rust: domain main @0x7f8203018810 root task failed
[1] 79399 exit 101 RUST_LOG=rustc=0,::rt::backtrace rustc bug.rs