pyo3/tests/ui/invalid_result_conversion.stderr
Lily Foote 5c41ea0ade
Implement From<Bound<'py, T>> for PyErr (#3881)
* Implement `From<Bound<'py, T>>` for PyErr

* Replace PyErr::from_value_bound calls with .into

* Fix From<MyError> expected error message

* Add a trait bound to From<Bound<'py, T>> for PyErr
2024-02-26 23:14:41 +00:00

19 lines
885 B
Plaintext

error[E0277]: the trait bound `PyErr: From<MyError>` is not satisfied
--> tests/ui/invalid_result_conversion.rs:21:1
|
21 | #[pyfunction]
| ^^^^^^^^^^^^^ the trait `From<MyError>` is not implemented for `PyErr`
|
= help: the following other types implement trait `From<T>`:
<PyErr as From<pyo3::Bound<'py, T>>>
<PyErr as From<std::io::Error>>
<PyErr as From<PyBorrowError>>
<PyErr as From<PyBorrowMutError>>
<PyErr as From<PyDowncastError<'a>>>
<PyErr as From<DowncastError<'_, '_>>>
<PyErr as From<DowncastIntoError<'_>>>
<PyErr as From<NulError>>
and $N others
= note: required for `MyError` to implement `Into<PyErr>`
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)