rust/src/test/compile-fail/mutable-huh-variance-ptr.rs
2012-03-26 18:35:18 -07:00

17 lines
226 B
Rust

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