31 lines
1.4 KiB
Plaintext
31 lines
1.4 KiB
Plaintext
error[E0599]: no method named `assert_into_py_result` found for enum `Result` in the current scope
|
|
--> tests/ui/invalid_result_conversion.rs:21:1
|
|
|
|
|
21 | #[pyfunction]
|
|
| ^^^^^^^^^^^^^ method not found in `Result<(), MyError>`
|
|
|
|
|
note: the method `assert_into_py_result` exists on the type `()`
|
|
--> src/impl_/ghost.rs
|
|
|
|
|
| fn assert_into_py_result(&mut self) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
help: use the `?` operator to extract the `()` value, propagating a `Result::Err` value to the caller
|
|
|
|
|
21 | #[pyfunction]?
|
|
| +
|
|
|
|
error[E0277]: the trait bound `Result<(), MyError>: IntoPyCallbackOutput<_>` is not satisfied
|
|
--> tests/ui/invalid_result_conversion.rs:21:1
|
|
|
|
|
21 | #[pyfunction]
|
|
| ^^^^^^^^^^^^^ the trait `IntoPyCallbackOutput<_>` is not implemented for `Result<(), MyError>`
|
|
|
|
|
= help: the trait `IntoPyCallbackOutput<U>` is implemented for `Result<T, E>`
|
|
note: required by a bound in `pyo3::callback::convert`
|
|
--> src/callback.rs
|
|
|
|
|
| T: IntoPyCallbackOutput<U>,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `pyo3::callback::convert`
|
|
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
|