86 lines
3.9 KiB
Plaintext
86 lines
3.9 KiB
Plaintext
error: `cancel_handle` may only be specified once per argument
|
|
--> tests/ui/invalid_cancel_handle.rs:4:55
|
|
|
|
|
4 | async fn cancel_handle_repeated(#[pyo3(cancel_handle, cancel_handle)] _param: String) {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `cancel_handle` may only be specified once
|
|
--> tests/ui/invalid_cancel_handle.rs:9:28
|
|
|
|
|
9 | #[pyo3(cancel_handle)] _param2: String,
|
|
| ^^^^^^^
|
|
|
|
error: `cancel_handle` attribute can only be used with `async fn`
|
|
--> tests/ui/invalid_cancel_handle.rs:14:53
|
|
|
|
|
14 | fn cancel_handle_synchronous(#[pyo3(cancel_handle)] _param: String) {}
|
|
| ^^^^^^
|
|
|
|
error: `from_py_with` and `cancel_handle` cannot be specified together
|
|
--> tests/ui/invalid_cancel_handle.rs:24:12
|
|
|
|
|
24 | #[pyo3(cancel_handle, from_py_with = "cancel_handle")] _param: pyo3::coroutine::CancelHandle,
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error[E0308]: mismatched types
|
|
--> tests/ui/invalid_cancel_handle.rs:16:1
|
|
|
|
|
16 | #[pyfunction]
|
|
| ^^^^^^^^^^^^^
|
|
| |
|
|
| expected `String`, found `CancelHandle`
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> tests/ui/invalid_cancel_handle.rs:17:10
|
|
|
|
|
17 | async fn cancel_handle_wrong_type(#[pyo3(cancel_handle)] _param: String) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ --------------
|
|
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0277]: the trait bound `CancelHandle: PyFunctionArgument<'_, '_>` is not satisfied
|
|
--> tests/ui/invalid_cancel_handle.rs:20:50
|
|
|
|
|
20 | async fn missing_cancel_handle_attribute(_param: pyo3::coroutine::CancelHandle) {}
|
|
| ^^^^ the trait `PyClass` is not implemented for `CancelHandle`, which is required by `CancelHandle: PyFunctionArgument<'_, '_>`
|
|
|
|
|
= help: the following other types implement trait `PyFunctionArgument<'a, 'py>`:
|
|
&'a mut pyo3::coroutine::Coroutine
|
|
&'a pyo3::Bound<'py, T>
|
|
&'a pyo3::coroutine::Coroutine
|
|
Option<&'a pyo3::Bound<'py, T>>
|
|
= note: required for `CancelHandle` to implement `FromPyObject<'_>`
|
|
= note: required for `CancelHandle` to implement `FromPyObjectBound<'_, '_>`
|
|
= note: required for `CancelHandle` to implement `PyFunctionArgument<'_, '_>`
|
|
note: required by a bound in `extract_argument`
|
|
--> src/impl_/extract_argument.rs
|
|
|
|
|
| pub fn extract_argument<'a, 'py, T>(
|
|
| ---------------- required by a bound in this function
|
|
...
|
|
| T: PyFunctionArgument<'a, 'py>,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `extract_argument`
|
|
|
|
error[E0277]: the trait bound `CancelHandle: PyFunctionArgument<'_, '_>` is not satisfied
|
|
--> tests/ui/invalid_cancel_handle.rs:20:50
|
|
|
|
|
20 | async fn missing_cancel_handle_attribute(_param: pyo3::coroutine::CancelHandle) {}
|
|
| ^^^^ the trait `Clone` is not implemented for `CancelHandle`, which is required by `CancelHandle: PyFunctionArgument<'_, '_>`
|
|
|
|
|
= help: the following other types implement trait `PyFunctionArgument<'a, 'py>`:
|
|
&'a mut pyo3::coroutine::Coroutine
|
|
&'a pyo3::Bound<'py, T>
|
|
&'a pyo3::coroutine::Coroutine
|
|
Option<&'a pyo3::Bound<'py, T>>
|
|
= note: required for `CancelHandle` to implement `FromPyObject<'_>`
|
|
= note: required for `CancelHandle` to implement `FromPyObjectBound<'_, '_>`
|
|
= note: required for `CancelHandle` to implement `PyFunctionArgument<'_, '_>`
|
|
note: required by a bound in `extract_argument`
|
|
--> src/impl_/extract_argument.rs
|
|
|
|
|
| pub fn extract_argument<'a, 'py, T>(
|
|
| ---------------- required by a bound in this function
|
|
...
|
|
| T: PyFunctionArgument<'a, 'py>,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `extract_argument`
|