mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Various fixes related to explicit copying and reinterpret_cast use.
This commit is contained in:
parent
aea47f6b99
commit
3f2d253a71
10 changed files with 18 additions and 18 deletions
|
@ -19,7 +19,7 @@ enum DOMString {
|
|||
type rust_box<T> = {rc: uint, td: *sys::TypeDesc, next: *(), prev: *(), payload: T};
|
||||
|
||||
unsafe fn squirrel_away<T>(+x: @T) -> *rust_box<T> {
|
||||
let y: *rust_box<T> = unsafe::reinterpret_cast(x);
|
||||
let y: *rust_box<T> = unsafe::reinterpret_cast(&x);
|
||||
unsafe::forget(x);
|
||||
y
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ unsafe fn squirrel_away<T>(+x: @T) -> *rust_box<T> {
|
|||
type rust_unique<T> = {payload: T};
|
||||
|
||||
unsafe fn squirrel_away_unique<T>(+x: ~T) -> *rust_box<T> {
|
||||
let y: *rust_box<T> = unsafe::reinterpret_cast(x);
|
||||
let y: *rust_box<T> = unsafe::reinterpret_cast(&x);
|
||||
unsafe::forget(x);
|
||||
y
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue