2015-01-28 13:34:18 +00:00
|
|
|
#[derive(Debug)]
|
2018-12-17 03:21:47 +00:00
|
|
|
struct R {
|
2015-01-08 10:54:35 +00:00
|
|
|
i:isize
|
2012-11-14 06:22:37 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
fn r(i:isize) -> R { R { i: i } }
|
2012-11-16 03:01:44 +00:00
|
|
|
|
2018-12-17 03:21:47 +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
|
|
|
}
|
2011-09-28 21:37:28 +00:00
|
|
|
|
|
|
|
fn main() {
|
2012-06-02 03:21:59 +00:00
|
|
|
// This can't make sense as it would copy the classes
|
2016-10-29 21:54:04 +00:00
|
|
|
let i = vec![r(0)];
|
|
|
|
let j = vec![r(1)];
|
2011-09-28 21:37:28 +00:00
|
|
|
let k = i + j;
|
2020-09-02 07:40:56 +00:00
|
|
|
//~^ ERROR cannot add `Vec<R>` to `Vec<R>`
|
2014-12-20 08:09:35 +00:00
|
|
|
println!("{:?}", j);
|
2011-11-18 11:39:20 +00:00
|
|
|
}
|