Convert reinterpret_cast + forget to 'transmute'
This commit is contained in:
parent
f12adcbf93
commit
7a74545e97
6 changed files with 12 additions and 31 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue