pypy: enable PyList::get_item_unchecked
This commit is contained in:
parent
0f70fc6e0c
commit
010dd509d7
1
newsfragments/2827.added.md
Normal file
1
newsfragments/2827.added.md
Normal file
|
@ -0,0 +1 @@
|
|||
Add `PyList::get_item_unchecked` for PyPy.
|
|
@ -142,7 +142,7 @@ impl PyList {
|
|||
/// # Safety
|
||||
///
|
||||
/// Caller must verify that the index is within the bounds of the list.
|
||||
#[cfg(not(any(Py_LIMITED_API, PyPy)))]
|
||||
#[cfg(not(Py_LIMITED_API))]
|
||||
pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny {
|
||||
let item = ffi::PyList_GET_ITEM(self.as_ptr(), index as Py_ssize_t);
|
||||
// PyList_GET_ITEM return borrowed ptr; must make owned for safety (see #890).
|
||||
|
|
Loading…
Reference in a new issue