From 8b246fda78858e55295ab72bde7ced9af4cbdaf6 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Fri, 21 Feb 2014 22:40:53 +1100 Subject: green,native,rustuv: Replace many pointer `transmute`'s with `as` or referencing. These can all be written in a more controlled manner than with the transmute hammer, leading to (hopefully) safer code. --- src/libnative/task.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libnative/task.rs') diff --git a/src/libnative/task.rs b/src/libnative/task.rs index ccfc040e7df..5682697ebfc 100644 --- a/src/libnative/task.rs +++ b/src/libnative/task.rs @@ -186,7 +186,7 @@ impl rt::Runtime for Ops { cur_task.put_runtime(self as ~rt::Runtime); unsafe { - let cur_task_dupe = *cast::transmute::<&~Task, &uint>(&cur_task); + let cur_task_dupe = &*cur_task as *Task; let task = BlockedTask::block(cur_task); if times == 1 { @@ -218,7 +218,7 @@ impl rt::Runtime for Ops { } } // re-acquire ownership of the task - cur_task = cast::transmute::(cur_task_dupe); + cur_task = cast::transmute(cur_task_dupe); } // put the task back in TLS, and everything is as it once was. -- cgit 1.4.1-3-g733a5