summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-variance-ptr.rs
blob: e98b9b34c5fce40a45c04eecf4ad6b3c64ae5954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// error-pattern: mismatched types

extern mod std;

fn main() {
    let a = ~[0];
    let v: *mut ~[int] = ptr::mut_addr_of(&a);

    fn f(&&v: *mut ~[const int]) {
        unsafe {
            *v = ~[mut 3]
        }
    }

    f(v);
}