rust/src/test/compile-fail/block-deinitializes-upvar.rs
Marijn Haverbeke fc6b7c8b38 Reformat for new mode syntax, step 1
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00

12 lines
292 B
Rust

// error-pattern:Tried to deinitialize a variable declared in a different
fn force(f: block() -> int) -> int { ret f(); }
fn main() {
let x = @{x: 17, y: 2};
let y = @{x: 5, y: 5};
let f = {|i| log_err i; x <- y; ret 7; };
assert (f(5) == 7);
log_err x;
log_err y;
}