summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-21 13:55:14 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-21 13:55:14 -0800
commit91cec5b57e1e0961d1f75ede168d37f4748f9478 (patch)
tree87dfef2e728dcceabeb5b753ff12b8b121637dba /src/liballoc
parente6f85c2f78bc0488c7cf08121b26dcbc85a846ba (diff)
downloadrust-91cec5b57e1e0961d1f75ede168d37f4748f9478.tar.gz
rust-91cec5b57e1e0961d1f75ede168d37f4748f9478.zip
Revert "Use assume to inform the optimiser about refcount invariants"
This reverts commit a729a404945de10f99e2530a5c28952996532b29.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/rc.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index ce160eec103..5e82c4f1ade 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -160,7 +160,6 @@ use core::option::Option::{Some, None};
 use core::ptr::{self, PtrExt};
 use core::result::Result;
 use core::result::Result::{Ok, Err};
-use core::intrinsics::assume;
 
 use heap::deallocate;
 
@@ -752,20 +751,10 @@ trait RcBoxPtr<T> {
     fn strong(&self) -> uint { self.inner().strong.get() }
 
     #[inline]
-    fn inc_strong(&self) {
-        let strong = self.strong();
-        // The reference count is always at least one unless we're about to drop the type
-        unsafe { assume(strong > 0); }
-        self.inner().strong.set(strong + 1);
-    }
+    fn inc_strong(&self) { self.inner().strong.set(self.strong() + 1); }
 
     #[inline]
-    fn dec_strong(&self) {
-        let strong = self.strong();
-        // The reference count is always at least one unless we're about to drop the type
-        unsafe { assume(strong > 0); }
-        self.inner().strong.set(strong - 1);
-    }
+    fn dec_strong(&self) { self.inner().strong.set(self.strong() - 1); }
 
     #[inline]
     fn weak(&self) -> uint { self.inner().weak.get() }