os-rust/tests/ui/array-slice-vec/vec-res-add.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
334 B
Rust
Raw Normal View History

2015-01-28 08:34:18 -05:00
#[derive(Debug)]
struct R {
i:isize
}
fn r(i:isize) -> R { R { i: i } }
2012-11-15 19:01:44 -08:00
impl Drop for R {
2013-09-16 21:18:07 -04:00
fn drop(&mut 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 = vec![r(0)];
let j = vec![r(1)];
let k = i + j;
//~^ ERROR cannot add `Vec<R>` to `Vec<R>`
println!("{:?}", j);
}