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.
9 lines
200 B
Rust
9 lines
200 B
Rust
fn main() {
|
|
let x : *~[int] = ptr::p2::addr_of(&~[1,2,3]);
|
|
let y : *libc::c_void = x as *libc::c_void;
|
|
unsafe {
|
|
let _z = *y;
|
|
//~^ ERROR copying a noncopyable value
|
|
}
|
|
}
|