rust/src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs
2012-08-01 19:16:06 -07:00

11 lines
232 B
Rust

fn to_lambda1(f: fn@(uint) -> uint) -> fn@(uint) -> uint {
return f;
}
fn to_lambda2(b: fn(uint) -> uint) -> fn@(uint) -> uint {
return to_lambda1({|x| b(x)}); //~ ERROR value may contain borrowed pointers
}
fn main() {
}