From 3cbd1e221ec9625e7879adb3fe406efd082cb60d Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 7 Jun 2012 07:18:24 -0700 Subject: [PATCH] mark addr_or and friends pure --- src/libcore/ptr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) }