rust/src/test/compile-fail/vec-res-add.rs
2012-08-17 10:13:45 -07:00

16 lines
265 B
Rust

// error-pattern: copying a noncopyable value
struct r {
let i:int;
new(i:int) {self.i = i;}
drop {}
}
fn main() {
// 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);
}