rust/src/test/run-pass/move-self.rs
2013-06-01 09:18:27 -07:00

19 lines
205 B
Rust

struct S {
x: ~str
}
impl S {
pub fn foo(self) {
self.bar();
}
pub fn bar(self) {
println(self.x);
}
}
pub fn main() {
let x = S { x: ~"Hello!" };
x.foo();
}