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

13 lines
342 B
Rust
Raw Normal View History

2011-12-20 23:56:21 -06:00
// error-pattern: copying a noncopyable value
class foo { let x: int; new(x: int) { self.x = x; } drop { } }
fn to_lambda2(b: foo) -> 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:
2012-08-01 19:30:05 -05:00
return fn@(u: uint, copy b) -> uint { 22u };
2011-12-20 23:56:21 -06:00
}
fn main() {
}