summary refs log tree commit diff
path: root/src/test/run-pass/auto-ref.rs
blob: bad85d9b9c9ef9b87e23e48ae17a9be3b9b2c0f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct Foo {
    x: int,
}

trait Stuff {
    fn printme();
}

impl &Foo : Stuff {
    fn printme() {
        io::println(fmt!("%d", self.x));
    }
}

fn main() {
    let x = Foo { x: 3 };
    x.printme();
}