rust/src/test/run-pass/issue-1895.rs
Tim Chevalier 48c763c098 Use the correct prestate for calls
The prestate for calls was getting set incorrectly to the poststate for the operator
in the call. This worked before since most of the time, operator expressions are
pure. Issue 1895 shows how this breaks when the operator is a closure that has a
move-in capture clause.

(I had a several-day, multi-file patch for this that didn't work... and then it
turned out to be a one-line fix. The joys of programming.)

Closes #1895
2012-03-01 09:16:26 -08:00

8 lines
91 B
Rust

fn main() {
let x = 1;
let y = fn@[move x]() -> int {
x
}();
}