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

13 lines
227 B
Rust

// error-pattern: copying a noncopyable value
fn to_lambda1(f: fn@(uint) -> uint) -> fn@(uint) -> uint {
ret f;
}
fn to_lambda2(b: fn(uint) -> uint) -> fn@(uint) -> uint {
ret to_lambda1({|x| b(x)});
}
fn main() {
}