Skip to content

Compatibility with pyo3 v0.5.1 #83

@rth

Description

@rth

There might be some compatibility issue with the pyo3 v0.5.1 (that was released yesterday).

When building the example whith rust nightly on Linux, using,

pyo3 = "^0.5.0-alpha.2"

I get the following compilation error,

Details
cargo rustc --lib --manifest-path Cargo.toml --features numpy/python3 pyo3/extension-module pyo3/python3 --verbose -- --crate-type cdylib --cfg=Py_3
       Fresh version_check v0.1.5
       Fresh cfg-if v0.1.6
       Fresh unicode-xid v0.1.0
       Fresh lazy_static v1.2.0
       Fresh ucd-util v0.1.3
       Fresh utf8-ranges v1.0.2
       Fresh proc-macro-hack-impl v0.4.1
       Fresh either v1.5.0
       Fresh rawpointer v0.1.0
       Fresh spin v0.4.10
       Fresh thread_local v0.3.6
       Fresh regex-syntax v0.6.3
       Fresh proc-macro-hack v0.4.1
       Fresh itertools v0.7.11
       Fresh libc v0.2.44
       Fresh proc-macro2 v0.4.24
       Fresh num-traits v0.2.6
       Fresh matrixmultiply v0.1.15
       Fresh memchr v2.1.1
       Fresh quote v0.6.10
       Fresh mashup-impl v0.1.9
       Fresh num-complex v0.2.1
       Fresh aho-corasick v0.6.9
       Fresh syn v0.15.22
       Fresh mashup v0.1.9
       Fresh ndarray v0.12.1
       Fresh regex v1.0.6
       Fresh pyo3-derive-backend v0.5.1
       Fresh pyo3cls v0.5.1
       Fresh pyo3 v0.5.1
   Compiling numpy v0.4.0-alpha.1 (https://github.com/rust-numpy/rust-numpy#baa3fe80)
     Running `rustc --crate-name numpy /usr/local/cargo/git/checkouts/rust-numpy-1fb78b81c057f15a/baa3fe8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="pyo3"' --cfg 'feature="python3"' -C metadata=f174001306587673 -C extra-filename=-f174001306587673 --out-dir /src/target/debug/deps -L dependency=/src/target/debug/deps --extern cfg_if=/src/target/debug/deps/libcfg_if-32003ddcb6e568a3.rlib --extern libc=/src/target/debug/deps/liblibc-89b670f2733249b5.rlib --extern ndarray=/src/target/debug/deps/libndarray-237fe81e53a83645.rlib --extern num_complex=/src/target/debug/deps/libnum_complex-cc3986fda7fdfc2b.rlib --extern num_traits=/src/target/debug/deps/libnum_traits-a15758b954e4bbaa.rlib --extern pyo3=/src/target/debug/deps/libpyo3-b1c63cababa068d5.rlib --cap-lints allow`
error[E0432]: unresolved import `pyo3::PyObjectWithToken`
 --> /usr/local/cargo/git/checkouts/rust-numpy-1fb78b81c057f15a/baa3fe8/src/array.rs:6:29
  |
6 | use pyo3::{PyDowncastError, PyObjectWithToken, ToPyPointer};
  |                             ^^^^^^^^^^^^^^^^^ no `PyObjectWithToken` in the root. Did you mean to use `PyObjectWithGIL`?

error[E0412]: cannot find type `T` in this scope
   --> /usr/local/cargo/git/checkouts/rust-numpy-1fb78b81c057f15a/baa3fe8/src/array.rs:104:13
    |
104 |     PyArray<T, D>,
    |             ^ not found in this scope

error[E0412]: cannot find type `D` in this scope
   --> /usr/local/cargo/git/checkouts/rust-numpy-1fb78b81c057f15a/baa3fe8/src/array.rs:104:16
    |
104 |     PyArray<T, D>,
    |                ^ not found in this scope

error[E0107]: wrong number of type arguments: expected 0, found 1
  --> /usr/local/cargo/git/checkouts/rust-numpy-1fb78b81c057f15a/baa3fe8/src/slice_box.rs:69:23
   |
69 | impl<T> PyObjectAlloc<SliceBox<T>> for SliceBox<T> {
   |                       ^^^^^^^^^^^ unexpected type argument

error: aborting due to 4 previous errors

Some errors occurred: E0107, E0412, E0432.
For more information about an error, try `rustc --explain E0107`.
error: Could not compile `numpy`.

while with pyo3 = "= 0.5.0" the example works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions