rust/src/test/ui/vec/vec-res-add.rs
LeSeulArtichaut eac6fac10b Update tests
2019-12-12 20:56:14 +01:00

20 lines
354 B
Rust

#[derive(Debug)]
struct R {
i:isize
}
fn r(i:isize) -> R { R { i: i } }
impl Drop for R {
fn drop(&mut self) {}
}
fn main() {
// This can't make sense as it would copy the classes
let i = vec![r(0)];
let j = vec![r(1)];
let k = i + j;
//~^ ERROR cannot add `std::vec::Vec<R>` to `std::vec::Vec<R>`
println!("{:?}", j);
}