diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index b90928727b16..2ce5550d9514 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -32,11 +32,11 @@ native mod rusti { #[doc = "Get an unsafe pointer to a value"] #[inline(always)] -fn addr_of(val: T) -> *T { rusti::addr_of(val) } +pure fn addr_of(val: T) -> *T { unchecked { rusti::addr_of(val) } } #[doc = "Get an unsafe mut pointer to a value"] #[inline(always)] -fn mut_addr_of(val: T) -> *mut T unsafe { +pure fn mut_addr_of(val: T) -> *mut T unsafe { unsafe::reinterpret_cast(rusti::addr_of(val)) }