bd573becf5
improve error message to describe kind of deref'd ptr using sigil
14 lines
224 B
Rust
14 lines
224 B
Rust
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);
|
|
}
|
|
}
|