about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-06-02 19:16:40 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-06-02 19:24:33 -0400
commit454133127a78e14ae4922d96579f1d1a433fa54c (patch)
treef9e28067580663eecced78d9d101404567487ec2 /src/libextra
parent077ca799418b291f45ccba072aedab4daeace057 (diff)
ptr: split out borrowed pointer utilities
The ptr module is intended to be for raw pointers.

Closes #3111
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/arc.rs3
-rw-r--r--src/libextra/sync.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs
index f4259afcaa3..6c838a82a2f 100644
--- a/src/libextra/arc.rs
+++ b/src/libextra/arc.rs
@@ -48,6 +48,7 @@ use core::cast;
 use core::unstable::sync::UnsafeAtomicRcBox;
 use core::ptr;
 use core::task;
+use core::borrow;
 
 /// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
 pub struct Condvar<'self> {
@@ -425,7 +426,7 @@ impl<T:Const + Owned> RWARC<T> {
             // of this cast is removing the mutability.)
             let new_data = cast::transmute_immut(data);
             // Downgrade ensured the token belonged to us. Just a sanity check.
-            assert!(ptr::ref_eq(&(*state).data, new_data));
+            assert!(borrow::ref_eq(&(*state).data, new_data));
             // Produce new token
             RWReadMode {
                 data: new_data,
diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs
index 29a2dec38ab..79ecf4abbee 100644
--- a/src/libextra/sync.rs
+++ b/src/libextra/sync.rs
@@ -17,6 +17,7 @@
 
 use core::prelude::*;
 
+use core::borrow;
 use core::comm;
 use core::ptr;
 use core::task;
@@ -589,7 +590,7 @@ impl RWlock {
     /// To be called inside of the write_downgrade block.
     pub fn downgrade<'a>(&self, token: RWlockWriteMode<'a>)
                          -> RWlockReadMode<'a> {
-        if !ptr::ref_eq(self, token.lock) {
+        if !borrow::ref_eq(self, token.lock) {
             fail!("Can't downgrade() with a different rwlock's write_mode!");
         }
         unsafe {