rust/src/test/compile-fail/cap-clause-move-upvar.rs
2012-03-05 17:05:20 -08:00

9 lines
194 B
Rust

// error-pattern:upvars (like 'x') cannot be moved into a closure
fn main() {
let x = 5;
let _y = fn~[move x]() -> int {
let _z = fn~[move x]() -> int { x };
22
};
}