rust/src/test/run-pass/last-use-in-cap-clause.rs
2012-05-04 12:33:08 -07:00

12 lines
175 B
Rust

// Make sure #1399 stays fixed
fn foo() -> fn@() -> int {
let k = ~22;
let _u = {a: k};
ret fn@(move k) -> int { 22 };
}
fn main() {
assert foo()() == 22;
}