rust/src/test/run-pass/move-self.rs
2013-05-03 20:01:42 -04:00

19 lines
205 B
Rust

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