2012-12-10 11:58:37 -08:00
|
|
|
struct S {
|
2013-01-10 10:59:58 -08:00
|
|
|
x: ~int
|
2012-12-10 11:58:37 -08:00
|
|
|
}
|
|
|
|
|
2013-02-26 17:47:41 -08:00
|
|
|
pub impl S {
|
2012-12-10 11:58:37 -08:00
|
|
|
fn foo(self) -> int {
|
2013-01-10 10:59:58 -08:00
|
|
|
self.bar();
|
2013-05-22 06:54:35 -04:00
|
|
|
return *self.x; //~ ERROR use of moved value: `self`
|
2012-12-10 11:58:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2013-01-10 10:59:58 -08:00
|
|
|
let x = S { x: ~1 };
|
2012-12-10 11:58:37 -08:00
|
|
|
io::println(x.foo().to_str());
|
|
|
|
}
|