Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jiter does not compile with the python feature #125

Closed
decorator-factory opened this issue Aug 2, 2024 · 3 comments · Fixed by #126
Closed

jiter does not compile with the python feature #125

decorator-factory opened this issue Aug 2, 2024 · 3 comments · Fixed by #126

Comments

@decorator-factory
Copy link

decorator-factory commented Aug 2, 2024

My Cargo.toml:

[package]
name = "scratch"
version = "0.1.0"
edition = "2021"

[dependencies]
jiter = { version = "0.5.0", features = ["python"] }

I get an error after running cargo build:

error[E0599]: the method `to_object` exists for reference `&BigInt`, but its trait bounds were not satisfied
   --> /home/df/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jiter-0.5.0/src/number_decoder.rs:121:62
    |
121 |             Self::Int(NumberInt::BigInt(big_int)) => big_int.to_object(py),
    |                                                              ^^^^^^^^^ method cannot be called on `&BigInt` due to unsatisfied trait bounds
    |
   ::: /home/df/.cargo/registry/src/index.crates.io-6f17d22bba15001f/num-bigint-0.4.6/src/bigint.rs:57:1
    |
57  | pub struct BigInt {
    | ----------------- doesn't satisfy `BigInt: pyo3::ToPyObject`
    |
    = note: the following trait bounds were not satisfied:
            `BigInt: pyo3::ToPyObject`
            which is required by `&BigInt: pyo3::ToPyObject`

error[E0599]: the method `to_object` exists for reference `&BigInt`, but its trait bounds were not satisfied
  --> /home/df/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jiter-0.5.0/src/value.rs:37:34
   |
37 |             Self::BigInt(b) => b.to_object(py),
   |                                  ^^^^^^^^^ method cannot be called on `&BigInt` due to unsatisfied trait bounds
   |
  ::: /home/df/.cargo/registry/src/index.crates.io-6f17d22bba15001f/num-bigint-0.4.6/src/bigint.rs:57:1
   |
57 | pub struct BigInt {
   | ----------------- doesn't satisfy `BigInt: pyo3::ToPyObject`
   |
   = note: the following trait bounds were not satisfied:
           `BigInt: pyo3::ToPyObject`
           which is required by `&BigInt: pyo3::ToPyObject`

What am I doing wrong?

System information:

  • rustc 1.80.0
  • Ubuntu 22.04
@samuelcolvin
Copy link
Member

It definitely does in tests.

Cc @davidhewitt, any pointers?

@davidhewitt
Copy link
Collaborator

I think #126 should fix this.

@decorator-factory
Copy link
Author

Thanks for looking into this 👍
this seems to work for me as a workaround

[dependencies]
jiter = { version = "0.5.0", features = ["python"]}
pyo3 = { version = "0.22.2", features = ["num-bigint"]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants