diff options
| author | David Weikersdorfer <517608+Danvil@users.noreply.github.com> | 2023-06-18 00:46:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-18 00:46:51 -0700 |
| commit | c4c428b6da234aea4aa639fac73828792d064a07 (patch) | |
| tree | 016f786b0aff2466c82c814f81597bf6a4857adf | |
| parent | 0c2c243342ec2a2427f0624fac5ac59f0ee6fbcd (diff) | |
| download | rust-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.rs | 2 |
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 } } |
