Closed
Description
Trying to compile this results in an ICE:
fn main() {
let mut buf = Vec::new();
|c: u8| buf.push(c);
}
error: internal compiler error: unexpected failure
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 'assertion failed: self.nodeid_to_index.contains_key(&id)', /Users/Luqman/rust/src/librustc/middle/dataflow.rs:226
Using the closure by either assigning it to a variable or just calling it makes the ICE go away. It also only seems to happen when you capture something.
cc: @pnkfelix