rust/src/test/compile-fail/borrowck-unary-move-2.rs

23 lines
333 B
Rust
Raw Normal View History

2012-08-15 20:46:55 -05:00
struct noncopyable {
i: (),
}
impl noncopyable : Drop {
fn finalize(&self) {
error!("dropped");
}
}
2012-09-05 17:58:43 -05:00
fn noncopyable() -> noncopyable {
noncopyable {
i: ()
}
}
enum wrapper = noncopyable;
fn main() {
let x1 = wrapper(noncopyable());
let _x2 = *x1; //~ ERROR moving out of enum content
}