pyo3/tests/ui/invalid_pyfunctions.stderr
David Hewitt d0f5b6af46
ci: updates for Rust 1.77 (#3978)
* ci: updates for Rust 1.77

* move `SendablePtr` inside of test which uses it
2024-03-22 20:43:23 +00:00

52 lines
2.1 KiB
Plaintext

error: Python functions cannot have generic type parameters
--> tests/ui/invalid_pyfunctions.rs:5:21
|
5 | fn generic_function<T>(value: T) {}
| ^
error: Python functions cannot have `impl Trait` arguments
--> tests/ui/invalid_pyfunctions.rs:8:36
|
8 | fn impl_trait_function(impl_trait: impl AsRef<PyAny>) {}
| ^^^^
error: wildcard argument names are not supported
--> tests/ui/invalid_pyfunctions.rs:11:22
|
11 | fn wildcard_argument(_: i32) {}
| ^
error: destructuring in arguments is not supported
--> tests/ui/invalid_pyfunctions.rs:14:26
|
14 | fn destructured_argument((a, b): (i32, i32)) {}
| ^^^^^^
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:17:63
|
17 | fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
| ^^^
error: expected `&PyModule` or `Py<PyModule>` as first argument with `pass_module`
--> tests/ui/invalid_pyfunctions.rs:20:37
|
20 | fn pass_module_but_no_arguments<'py>() {}
| ^^
error[E0277]: the trait bound `&str: From<BoundRef<'_, '_, pyo3::prelude::PyModule>>` is not satisfied
--> tests/ui/invalid_pyfunctions.rs:24:13
|
24 | string: &str,
| ^ the trait `From<BoundRef<'_, '_, pyo3::prelude::PyModule>>` is not implemented for `&str`, which is required by `BoundRef<'_, '_, pyo3::prelude::PyModule>: Into<_>`
|
= help: the following other types implement trait `From<T>`:
<String as From<char>>
<String as From<Box<str>>>
<String as From<Cow<'a, str>>>
<String as From<&str>>
<String as From<&mut str>>
<String as From<&String>>
= note: required for `BoundRef<'_, '_, pyo3::prelude::PyModule>` to implement `Into<&str>`