rust/src/test/run-pass/lambda-no-leak.rs

8 lines
179 B
Rust
Raw Normal View History

// Make sure we don't leak fn@s in silly ways.
fn force(f: fn@()) { f() }
fn main() {
let x = 7;
2012-01-10 08:49:15 -06:00
let _f = fn@() { log(error, x); };
force(fn@() { log(error, x); });
}