summary refs log tree commit diff
path: root/src/test/run-pass/move-self.rs
blob: 55a7edbb679c6df17dc0b044e340ad72888747a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();
}