Skip to content

Commit 882d047

Browse files
Fix experimental access to extern crates
I can't compile the current code because of the following error: ``` error[E0658]: access to extern crates through prelude is experimental (see issue #44660) --> rust-numpy/src/array.rs:183:59 | 183 | pub unsafe fn from_borrowed_ptr(py: Python, ptr: *mut pyo3::ffi::PyObject) -> &Self { | ^^^^ | = help: add #![feature(extern_prelude)] to the crate attributes to enable ``` Using ffi instead of pyo3::ffi is enough for fixing that. (question: how does it works on Travis?)
1 parent f603610 commit 882d047

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ impl<T, D> PyArray<T, D> {
175175
}
176176

177177
/// Constructs `PyArray` from raw python object without incrementing reference counts.
178-
pub unsafe fn from_owned_ptr(py: Python, ptr: *mut pyo3::ffi::PyObject) -> &Self {
178+
pub unsafe fn from_owned_ptr(py: Python, ptr: *mut ffi::PyObject) -> &Self {
179179
py.from_owned_ptr(ptr)
180180
}
181181

182182
/// Constructs PyArray from raw python object and increments reference counts.
183-
pub unsafe fn from_borrowed_ptr(py: Python, ptr: *mut pyo3::ffi::PyObject) -> &Self {
183+
pub unsafe fn from_borrowed_ptr(py: Python, ptr: *mut ffi::PyObject) -> &Self {
184184
py.from_borrowed_ptr(ptr)
185185
}
186186

0 commit comments

Comments
 (0)