diff options
| author | bors <bors@rust-lang.org> | 2014-05-01 23:41:46 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-01 23:41:46 -0700 |
| commit | e97d4e6c190764de1240c2e8a5ac253a60faac6b (patch) | |
| tree | 132dcc092d1d34ffff6c2be5c65952609c0a8298 /src/libstd/cell.rs | |
| parent | adcbf539550eab5ef0b351b1d198d10acecf5301 (diff) | |
| parent | ca84d79375dd9be35d3cb7fb0d3b2803092c56c1 (diff) | |
| download | rust-e97d4e6c190764de1240c2e8a5ac253a60faac6b.tar.gz rust-e97d4e6c190764de1240c2e8a5ac253a60faac6b.zip | |
auto merge of #13789 : sfackler/rust/debug-assert, r=pcwalton
I switched the `assert!` calls in `RefCell` over to `debug_assert!`. There are probably other instances that should be converted as well, but I couldn't think of any off the top of my head. RFC: 0015-assert
Diffstat (limited to 'src/libstd/cell.rs')
| -rw-r--r-- | src/libstd/cell.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index ec064f4f5ec..1e4faf1a899 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -93,7 +93,7 @@ impl<T> RefCell<T> { /// Consumes the `RefCell`, returning the wrapped value. pub fn unwrap(self) -> T { - assert!(self.borrow.get() == UNUSED); + debug_assert!(self.borrow.get() == UNUSED); unsafe{self.value.unwrap()} } @@ -181,7 +181,7 @@ pub struct Ref<'b, T> { impl<'b, T> Drop for Ref<'b, T> { fn drop(&mut self) { let borrow = self.parent.borrow.get(); - assert!(borrow != WRITING && borrow != UNUSED); + debug_assert!(borrow != WRITING && borrow != UNUSED); self.parent.borrow.set(borrow - 1); } } @@ -202,7 +202,7 @@ pub struct RefMut<'b, T> { impl<'b, T> Drop for RefMut<'b, T> { fn drop(&mut self) { let borrow = self.parent.borrow.get(); - assert!(borrow == WRITING); + debug_assert!(borrow == WRITING); self.parent.borrow.set(UNUSED); } } |
