2012-12-10 13:58:37 -06:00
|
|
|
struct S {
|
|
|
|
x: int
|
|
|
|
}
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
fn foo(self) -> int {
|
|
|
|
(move self).bar();
|
2013-01-11 14:47:14 -06:00
|
|
|
return self.x; //~ ERROR use of moved value
|
2012-12-10 13:58:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = S { x: 1 };
|
|
|
|
io::println(x.foo().to_str());
|
|
|
|
}
|
|
|
|
|