Skip to content

Commit 3cbd1e2

Browse files
committed
mark addr_or and friends pure
1 parent 5f4837a commit 3cbd1e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ native mod rusti {
3232

3333
#[doc = "Get an unsafe pointer to a value"]
3434
#[inline(always)]
35-
fn addr_of<T>(val: T) -> *T { rusti::addr_of(val) }
35+
pure fn addr_of<T>(val: T) -> *T { unchecked { rusti::addr_of(val) } }
3636

3737
#[doc = "Get an unsafe mut pointer to a value"]
3838
#[inline(always)]
39-
fn mut_addr_of<T>(val: T) -> *mut T unsafe {
39+
pure fn mut_addr_of<T>(val: T) -> *mut T unsafe {
4040
unsafe::reinterpret_cast(rusti::addr_of(val))
4141
}
4242

0 commit comments

Comments
 (0)