1
Fork 0

Convert reinterpret_cast + forget to 'transmute'

This commit is contained in:
Brian Anderson 2012-06-08 00:28:29 -07:00
parent f12adcbf93
commit 7a74545e97
6 changed files with 12 additions and 31 deletions

View file

@ -40,8 +40,7 @@ type arc<T: const> = arc_destruct<T>;
fn arc<T: const>(-data: T) -> arc<T> {
let data = ~{mut count: 1, data: data};
unsafe {
let ptr = unsafe::reinterpret_cast(data);
unsafe::forget(data);
let ptr = unsafe::transmute(data);
arc_destruct(ptr)
}
}