rust/src/test/run-pass/lambda-no-leak.rs
2012-01-10 13:31:06 -08:00

8 lines
179 B
Rust

// Make sure we don't leak fn@s in silly ways.
fn force(f: fn@()) { f() }
fn main() {
let x = 7;
let _f = fn@() { log(error, x); };
force(fn@() { log(error, x); });
}