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 13:34:18 +00:00
#[derive(Debug)]
struct R {
i:isize
}
fn r(i:isize) -> R { R { i: i } }
2012-11-16 03:01:44 +00:00
impl Drop for R {
2013-09-17 01:18:07 +00:00
fn drop(&mut self) {}
2012-06-02 03:21:59 +00:00
}
fn main() {
2012-06-02 03:21:59 +00: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);
}