mozilla/rust — pull request #14708 by gereeter (2014-06-06 21:54:51+00:00)
Title: Make sync::raw::Sem use Unsafe to manage mutability instead of *()

Currently, `Sem`, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement `Share` and be able to mutate the stored `WaitQueue` by hiding it all behind a `transmute`d `*()`. This PR replaces all that ugly machinery with `Unsafe`. Beyond being cleaner and not requiring `transmute`, this removes an allocation in the creation and removes an indirection for access.