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