pyo3/tests/ui/invalid_pyfunctions.rs

27 lines
567 B
Rust
Raw Normal View History

2021-03-09 23:37:01 +00:00
use pyo3::prelude::*;
#[pyfunction]
fn generic_function<T>(value: T) {}
#[pyfunction]
fn impl_trait_function(impl_trait: impl AsRef<PyAny>) {}
#[pyfunction]
fn wildcard_argument(_: i32) {}
#[pyfunction]
fn destructured_argument((a, b): (i32, i32)) {}
#[pyfunction]
fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
#[pyfunction(pass_module)]
fn pass_module_but_no_arguments<'py>() {}
#[pyfunction(pass_module)]
fn first_argument_not_module<'py>(string: &str, module: &'py PyModule) -> PyResult<&'py str> {
module.name()
}
2021-03-09 23:37:01 +00:00
fn main() {}