@@ -15,7 +15,7 @@ use crate::error::BorrowError;
15
15
/// Defines the shared C API used for borrow checking
16
16
///
17
17
/// This structure will be placed into a capsule at
18
- /// `numpy.core.multiarray._BORROW_CHECKING_API `.
18
+ /// `numpy.core.multiarray._RUST_NUMPY_BORROW_CHECKING_API `.
19
19
///
20
20
/// All functions exposed here assume the GIL is held
21
21
/// while they are called.
@@ -175,14 +175,14 @@ fn get_or_insert_shared<'py>(py: Python<'py>) -> PyResult<&'py Shared> {
175
175
}
176
176
177
177
// This function will publish this extensions version of the shared borrow checking API
178
- // as a capsule placed at `numpy.core.multiarray._BORROW_CHECKING_API ` and
178
+ // as a capsule placed at `numpy.core.multiarray._RUST_NUMPY_BORROW_CHECKING_API ` and
179
179
// immediately initialize the cache used access it from this extension.
180
180
181
181
#[ cold]
182
182
fn insert_shared ( py : Python ) -> PyResult < * const Shared > {
183
183
let module = get_array_module ( py) ?;
184
184
185
- let capsule: & PyCapsule = match module. getattr ( "_BORROW_CHECKING_API " ) {
185
+ let capsule: & PyCapsule = match module. getattr ( "_RUST_NUMPY_BORROW_CHECKING_API " ) {
186
186
Ok ( capsule) => capsule. try_into ( ) ?,
187
187
Err ( _err) => {
188
188
let flags = Box :: into_raw ( Box :: new ( BorrowFlags :: default ( ) ) ) ;
@@ -199,13 +199,13 @@ fn insert_shared(py: Python) -> PyResult<*const Shared> {
199
199
let capsule = PyCapsule :: new_with_destructor (
200
200
py,
201
201
shared,
202
- Some ( CString :: new ( "_BORROW_CHECKING_API " ) . unwrap ( ) ) ,
202
+ Some ( CString :: new ( "_RUST_NUMPY_BORROW_CHECKING_API " ) . unwrap ( ) ) ,
203
203
|shared, _ctx| {
204
204
// SAFETY: `shared.flags` was initialized using `Box::into_raw`.
205
205
let _ = unsafe { Box :: from_raw ( shared. flags as * mut BorrowFlags ) } ;
206
206
} ,
207
207
) ?;
208
- module. setattr ( "_BORROW_CHECKING_API " , capsule) ?;
208
+ module. setattr ( "_RUST_NUMPY_BORROW_CHECKING_API " , capsule) ?;
209
209
capsule
210
210
}
211
211
} ;
0 commit comments