rust/src/test/compile-fail/mutable-huh-variance-ptr.rs

17 lines
238 B
Rust
Raw Normal View History

// error-pattern: mismatched types
use std;
fn main() {
let a = [0];
let v: *mutable [int] = ptr::mut_addr_of(a);
2011-11-16 16:41:32 -06:00
fn f(&&v: *mutable [const int]) {
unsafe {
*v = [mutable 3]
}
}
f(v);
}