summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-variance-ptr.rs
blob: 852b474eebb5dfe64373499ba88372ba1be6dd87 (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);
}