summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-ptr-assign.rs
blob: 4b680ec8b70741b83983e9e98fdd12fdcc689b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
extern mod std;

fn main() {
    unsafe fn f(&&v: *const int) {
        *v = 1 //~ ERROR assigning to dereference of const * pointer
    }

    unsafe {
        let a = 0;
        let v = ptr::mut_addr_of(&a);
        f(v);
    }
}