3639d38d5c
Currently, the new version is ptr::p2::addr_of and the old one is ptr::addr_of. This is kind of cheesy, but I need a snapshot before I can ditch the old version, since the pipe compiler generates calls to addr_of. core is converted over to use the new version, std is not.
17 lines
238 B
Rust
17 lines
238 B
Rust
// error-pattern: mismatched types
|
|
|
|
extern mod 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);
|
|
}
|