18 lines
251 B
Rust
18 lines
251 B
Rust
struct S {
|
|
x: ~int
|
|
}
|
|
|
|
impl S {
|
|
pub fn foo(self) -> int {
|
|
self.bar();
|
|
return *self.x; //~ ERROR use of moved value: `self`
|
|
}
|
|
|
|
pub fn bar(self) {}
|
|
}
|
|
|
|
fn main() {
|
|
let x = S { x: ~1 };
|
|
println(x.foo().to_str());
|
|
}
|