summary refs log tree commit diff
path: root/src/test/run-pass/explicit-self-closures.rs
blob: 162c62803c3c833d2e30105a8ab1006b12abccd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test to make sure that explicit self params work inside closures

struct Box {
    x: uint
}

impl Box {
    fn set_many(&mut self, xs: &[uint]) {
        for xs.each |x| { self.x = *x; }
    }
    fn set_many2(@mut self, xs: &[uint]) {
        for xs.each |x| { self.x = *x; }
    }
    fn set_many3(~mut self, xs: &[uint]) {
        for xs.each |x| { self.x = *x; }
    }
}

fn main() {}