diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-21 22:40:53 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-24 01:15:39 +1100 |
| commit | 8b246fda78858e55295ab72bde7ced9af4cbdaf6 (patch) | |
| tree | 3af1881f7f980361f5650d23a3e66418e519b421 /src/libnative | |
| parent | 06e3e63c9046c160a00122990f31b82dd729a4a3 (diff) | |
| download | rust-8b246fda78858e55295ab72bde7ced9af4cbdaf6.tar.gz rust-8b246fda78858e55295ab72bde7ced9af4cbdaf6.zip | |
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.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/task.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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::<uint, ~Task>(cur_task_dupe); + cur_task = cast::transmute(cur_task_dupe); } // put the task back in TLS, and everything is as it once was. |
