summary refs log tree commit diff
path: root/src/test/compile-fail/mutable-huh-ptr-assign.rs
blob: 1aa965869be5600654fdefbae8941980e4c28107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use 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);
    }
}