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-05-31 17:17:22 -05:00
|
|
|
impl S {
|
|
|
|
pub fn foo(self) -> int {
|
2013-01-10 12:59:58 -06:00
|
|
|
self.bar();
|
2013-05-22 05:54:35 -05:00
|
|
|
return *self.x; //~ ERROR use of moved value: `self`
|
2012-12-10 13:58:37 -06:00
|
|
|
}
|
|
|
|
|
2013-05-31 17:17:22 -05:00
|
|
|
pub fn bar(self) {}
|
2012-12-10 13:58:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2013-01-10 12:59:58 -06:00
|
|
|
let x = S { x: ~1 };
|
2013-05-24 21:35:29 -05:00
|
|
|
println(x.foo().to_str());
|
2012-12-10 13:58:37 -06:00
|
|
|
}
|