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

error[E0277]: the trait bound Duration: rigetti_pyo3::PyTryFrom<pyo3::Py<PyDelta>> is not satisfied #475

Closed
yurivict opened this issue Jun 14, 2024 · 2 comments · Fixed by #476
Assignees

Comments

@yurivict
Copy link

yurivict commented Jun 14, 2024

The build fails:

error[E0277]: the trait bound `Duration: rigetti_pyo3::PyTryFrom<pyo3::Py<PyDelta>>` is not satisfied
  --> crates/python/src/execution_data.rs:72:1
   |
72 | / py_wrap_data_struct! {
73 | |     #[pyo3(module = "qcs_sdk")]
74 | |     #[derive(Debug, PartialEq)]
75 | |     PyExecutionData(ExecutionData) as "ExecutionData" {
...  |
78 | |     }
79 | | }     
   | |_^ the trait `rigetti_pyo3::PyTryFrom<pyo3::Py<PyDelta>>` is not implemented for `Duration`, which is required by `std::option::Option<Duration>: rigetti_pyo3::PyTryFrom<std::option::Option<pyo3::Py<PyDelta>>>`
   |
   = help: the following other types implement trait `rigetti_pyo3::PyTryFrom<P>`:
             <bool as rigetti_pyo3::PyTryFrom<bool>>
             <bool as rigetti_pyo3::PyTryFrom<pyo3::Py<PyBool>>>
             <bool as rigetti_pyo3::PyTryFrom<PyAny>>
             <bool as rigetti_pyo3::PyTryFrom<PyBool>>
             <isize as rigetti_pyo3::PyTryFrom<isize>>
             <isize as rigetti_pyo3::PyTryFrom<pyo3::Py<PyInt>>>
             <isize as rigetti_pyo3::PyTryFrom<PyAny>>
             <isize as rigetti_pyo3::PyTryFrom<PyInt>>
           and 273 others
   = note: required for `std::option::Option<Duration>` to implement `rigetti_pyo3::PyTryFrom<std::option::Option<pyo3::Py<PyDelta>>>`
   = note: this error originates in the macro `$crate::private_intermediate_try_from_python` which comes from the expansion of the macro `py_wrap_data_struct` (in Nightly builds, run with -Z macro-backtrace for more info)

Version: 0.17.9
rust-1.78.0
FreeBSD 14.1

@antalsz
Copy link
Contributor

antalsz commented Jun 14, 2024

Thanks for catching this – looks like the change I made in rigetti/rigetti-pyo3#45 was breaking, which I didn't realize. I think the fix for this is as simple as adding the time feature to rigetti-pyo3; I'll put up a PR for that immediately!

@antalsz
Copy link
Contributor

antalsz commented Jun 14, 2024

@yurivict I think #476 should fix your problems, but give us a shout if there's still anything going wrong!

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.

2 participants