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-05-31 15:17:22 -07:00
|
|
|
impl S {
|
|
|
|
pub 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
|
|
|
}
|
|
|
|
|
2013-05-31 15:17:22 -07:00
|
|
|
pub fn bar(self) {}
|
2012-12-10 11:58:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2013-01-10 10:59:58 -08:00
|
|
|
let x = S { x: ~1 };
|
2013-05-24 19:35:29 -07:00
|
|
|
println(x.foo().to_str());
|
2012-12-10 11:58:37 -08:00
|
|
|
}
|