mark addr_or and friends pure

This commit is contained in:
Niko Matsakis
2012-06-07 07:18:24 -07:00
parent 5f4837ad6a
commit 3cbd1e221e

View File

@@ -32,11 +32,11 @@ native mod rusti {
#[doc = "Get an unsafe pointer to a value"] #[doc = "Get an unsafe pointer to a value"]
#[inline(always)] #[inline(always)]
fn addr_of<T>(val: T) -> *T { rusti::addr_of(val) } pure fn addr_of<T>(val: T) -> *T { unchecked { rusti::addr_of(val) } }
#[doc = "Get an unsafe mut pointer to a value"] #[doc = "Get an unsafe mut pointer to a value"]
#[inline(always)] #[inline(always)]
fn mut_addr_of<T>(val: T) -> *mut T unsafe { pure fn mut_addr_of<T>(val: T) -> *mut T unsafe {
unsafe::reinterpret_cast(rusti::addr_of(val)) unsafe::reinterpret_cast(rusti::addr_of(val))
} }