Skip to content

Commit 347888d

Browse files
committed
Fix unintended usage of global where self was intended.
1 parent 3d00ad7 commit 347888d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/borrow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl BorrowFlags {
256256
fn acquire(&self, _py: Python, address: *mut u8, key: BorrowKey) -> Result<(), BorrowError> {
257257
// SAFETY: Having `_py` implies holding the GIL and
258258
// we are not calling into user code which might re-enter this function.
259-
let borrow_flags = unsafe { BORROW_FLAGS.get() };
259+
let borrow_flags = unsafe { self.get() };
260260

261261
match borrow_flags.entry(address) {
262262
Entry::Occupied(entry) => {
@@ -299,7 +299,7 @@ impl BorrowFlags {
299299
fn release(&self, _py: Python, address: *mut u8, key: BorrowKey) {
300300
// SAFETY: Having `_py` implies holding the GIL and
301301
// we are not calling into user code which might re-enter this function.
302-
let borrow_flags = unsafe { BORROW_FLAGS.get() };
302+
let borrow_flags = unsafe { self.get() };
303303

304304
let same_base_arrays = borrow_flags.get_mut(&address).unwrap();
305305

@@ -324,7 +324,7 @@ impl BorrowFlags {
324324
) -> Result<(), BorrowError> {
325325
// SAFETY: Having `_py` implies holding the GIL and
326326
// we are not calling into user code which might re-enter this function.
327-
let borrow_flags = unsafe { BORROW_FLAGS.get() };
327+
let borrow_flags = unsafe { self.get() };
328328

329329
match borrow_flags.entry(address) {
330330
Entry::Occupied(entry) => {
@@ -361,7 +361,7 @@ impl BorrowFlags {
361361
fn release_mut(&self, _py: Python, address: *mut u8, key: BorrowKey) {
362362
// SAFETY: Having `_py` implies holding the GIL and
363363
// we are not calling into user code which might re-enter this function.
364-
let borrow_flags = unsafe { BORROW_FLAGS.get() };
364+
let borrow_flags = unsafe { self.get() };
365365

366366
let same_base_arrays = borrow_flags.get_mut(&address).unwrap();
367367

0 commit comments

Comments
 (0)