rust/src/test/compile-fail/cap-clause-move-upvar.rs

9 lines
194 B
Rust
Raw Normal View History

2012-03-05 16:27:27 -08:00
// 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
};
}