rust/src/test/compile-fail/cap-clause-illegal-cap.rs

11 lines
288 B
Rust
Raw Normal View History

2011-12-20 23:56:21 -06:00
// error-pattern: copying a noncopyable value
2012-01-23 16:59:00 -06:00
fn to_lambda2(b: fn(uint) -> uint) -> fn@(uint) -> uint {
2011-12-20 23:56:21 -06:00
// test case where copy clause specifies a value that is not used
// in fn@ body, but value is illegal to copy:
ret fn@[copy b](u: uint) -> uint { 22u };
2011-12-20 23:56:21 -06:00
}
fn main() {
}