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

use 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);
}