Created
February 6, 2017 22:49
-
-
Save niksaak/23456698c8cca964ece740072a1d041c to your computer and use it in GitHub Desktop.
Well, it's the safety dance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsafe fn as_undead<'a, T>(t: &T) -> &'static T { | |
// I say, we can dance, we can dance | |
// Everybody look at your hands | |
&*(t as *const T) | |
} | |
unsafe fn as_undead_mut<'a, T>(t: &'mut T) -> &'static mut T { | |
// We can dance, we can dance | |
// Everybody's taking the chance | |
&mut *(t as *mut T) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment