rust-lang/rust — pull request #19465 by nwin (2014-12-02 17:55:26+00:00)
Title: Add a safer version of transmute for references

Add the two function core::mem::transmute_ref and core::mem::transmute_ref_mut.

If transmute is needed, it is commonly used to cast references. I argue that it is in most cases undesired to change the lifetime of the reference during this cast. The added functions preserve these annotations and are thus safer to use for references.