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

20 lines
338 B
Rust
Raw Normal View History

// error-pattern: instantiating a type parameter with an incompatible type
2012-08-15 18:46:55 -07:00
struct r {
2012-11-15 19:01:44 -08:00
i:int
}
2012-11-15 19:01:44 -08:00
fn r(i:int) -> r { r { i: i } }
impl r : Drop {
fn finalize(&self) {}
2012-06-01 20:21:59 -07:00
}
fn main() {
2012-06-01 20:21:59 -07:00
// This can't make sense as it would copy the classes
let i = move ~[r(0)];
let j = move ~[r(1)];
let k = i + j;
log(debug, j);
}