2021-03-09 23:37:01 +00:00
error: Python functions cannot have generic type parameters
2021-10-12 00:52:24 +00:00
--> tests/ui/invalid_pyfunctions.rs:4:21
2021-03-09 23:37:01 +00:00
|
4 | fn generic_function<T>(value: T) {}
| ^
error: Python functions cannot have `impl Trait` arguments
2021-10-12 00:52:24 +00:00
--> tests/ui/invalid_pyfunctions.rs:7:36
2021-03-09 23:37:01 +00:00
|
7 | fn impl_trait_function(impl_trait: impl AsRef<PyAny>) {}
| ^^^^
2021-05-25 10:31:48 +00:00
error: `async fn` is not yet supported for Python functions.
2022-01-13 21:25:23 +00:00
Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
2021-10-12 00:52:24 +00:00
--> tests/ui/invalid_pyfunctions.rs:10:1
2021-05-25 10:31:48 +00:00
|
10 | async fn async_function() {}
| ^^^^^
2023-03-07 14:18:57 +00:00
error: wildcard argument names are not supported
--> tests/ui/invalid_pyfunctions.rs:13:22
|
13 | fn wildcard_argument(_: i32) {}
| ^
error: destructuring in arguments is not supported
--> tests/ui/invalid_pyfunctions.rs:16:26
|
16 | fn destructured_argument((a, b): (i32, i32)) {}
| ^^^^^^
2023-06-13 07:19:43 +00:00
error: required arguments after an `Option<_>` argument are ambiguous
= help: add a `#[pyo3(signature)]` annotation on this function to unambiguously specify the default values for all optional parameters
--> tests/ui/invalid_pyfunctions.rs:19:63
|
19 | fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
| ^^^