summary refs log tree commit diff
path: root/src/test/run-pass/issue-1989.rs
blob: a389730f0422bb6d8f9970c42c4bad3462d6cdd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// exec-env:RUST_CC_ZEAL=1

enum maybe_pointy {
    none,
    p(@pointy)
}

type pointy = {
    mut a : maybe_pointy,
    mut f : fn@()->(),
};

fn empty_pointy() -> @pointy {
    return @{
        mut a : none,
        mut f : fn@()->(){},
    }
}

fn main()
{
    let v = ~[empty_pointy(), empty_pointy()];
    v[0].a = p(v[0]);
}