rust/src/test/compile-fail/copy-a-resource.rs
2012-11-14 19:26:37 -08:00

18 lines
232 B
Rust

// error-pattern: copying a noncopyable value
struct foo {
i: int,
}
impl foo : Drop {
fn finalize() {}
}
fn foo(i:int) -> foo {
foo {
i: i
}
}
fn main() { let x = move foo(10); let y = x; log(error, x); }