about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Weikersdorfer <517608+Danvil@users.noreply.github.com>2023-06-18 00:46:51 -0700
committerGitHub <noreply@github.com>2023-06-18 00:46:51 -0700
commitc4c428b6da234aea4aa639fac73828792d064a07 (patch)
tree016f786b0aff2466c82c814f81597bf6a4857adf
parent0c2c243342ec2a2427f0624fac5ac59f0ee6fbcd (diff)
downloadrust-c4c428b6da234aea4aa639fac73828792d064a07.tar.gz
rust-c4c428b6da234aea4aa639fac73828792d064a07.zip
Use BorrowFlag instead of explicit isize
The integer type tracking borrow count has a typedef called `BorrowFlag`. This type should be used instead of explicit `isize`.
-rw-r--r--library/core/src/cell.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index c1cc892eb86..b1b15e84dbf 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -1756,7 +1756,7 @@ impl<'b> BorrowRefMut<'b> {
         let borrow = self.borrow.get();
         debug_assert!(is_writing(borrow));
         // Prevent the borrow counter from underflowing.
-        assert!(borrow != isize::MIN);
+        assert!(borrow != BorrowFlag::MIN);
         self.borrow.set(borrow - 1);
         BorrowRefMut { borrow: self.borrow }
     }