rust/src/test/compile-fail/vec-res-add.rs

16 lines
264 B
Rust
Raw Normal View History

// error-pattern: copying a noncopyable value
2012-06-01 20:21:59 -07:00
class r {
2012-06-06 14:58:41 -07:00
let i:int;
new(i:int) {self.i = i;}
2012-06-01 20:21:59 -07:00
drop {}
}
fn main() {
2012-06-01 20:21:59 -07:00
// This can't make sense as it would copy the classes
let i <- ~[r(0)];
let j <- ~[r(1)];
let k = i + j;
log(debug, j);
}