From 7606b4636d4a775c043013bd152edc28419f445a Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Mon, 1 Feb 2016 15:03:46 -0500 Subject: [PATCH] use Box::into_raw instead of transmute --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dde0b40..0b99ad0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -115,13 +115,10 @@ macro_rules! lazy_static { #[inline(always)] #[cfg(not(feature="nightly"))] unsafe fn __stability() -> &'static $T { - use std::mem::transmute; - static mut DATA: *const $T = 0 as *const $T; static mut ONCE: Once = ONCE_INIT; ONCE.call_once(|| { - DATA = transmute::, *const $T>( - Box::new(__static_ref_initialize())); + DATA = Box::into_raw(Box::new(__static_ref_initialize())); }); &*DATA }