1
Fork 0
rust/src/test/ui/unique-object-noncopyable.rs

26 lines
352 B
Rust
Raw Normal View History

2015-01-07 18:53:58 -08:00
#![feature(box_syntax)]
2012-10-31 15:09:26 -07:00
trait Foo {
fn f(&self);
2012-10-31 15:09:26 -07:00
}
struct Bar {
x: isize,
}
impl Drop for Bar {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {}
2012-10-31 15:09:26 -07:00
}
impl Foo for Bar {
fn f(&self) {
println!("hi");
2012-10-31 15:09:26 -07:00
}
}
fn main() {
let x = box Bar { x: 10 };
let y: Box<Foo> = x as Box<Foo>;
let _z = y.clone(); //~ ERROR no method named `clone` found
2012-10-31 15:09:26 -07:00
}