mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
20 lines
334 B
Rust
20 lines
334 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 `Vec<R>` to `Vec<R>`
|
|
println!("{:?}", j);
|
|
}
|