@@ -6,7 +6,11 @@ error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument
66 |
77 = note: implement `FromPyObject` to enable using `AtomicPtr<()>` as a function argument
88 = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
9- = help: the trait `PyClass` is implemented for `Foo`
9+ help: the trait `PyClass` is implemented for `Foo`
10+ --> tests/ui/invalid_pyfunction_argument.rs:9:1
11+ |
12+ 9 | #[pyclass(skip_from_py_object)]
13+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1014 = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>`
1115 = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>`
1216note: required by a bound in `extract_argument`
@@ -17,6 +21,7 @@ note: required by a bound in `extract_argument`
1721...
1822 | T: PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>,
1923 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `extract_argument`
24+ = note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
2025
2126error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument
2227 --> tests/ui/invalid_pyfunction_argument.rs:5:37
@@ -26,11 +31,26 @@ error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument
2631 |
2732 = note: implement `FromPyObject` to enable using `AtomicPtr<()>` as a function argument
2833 = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
29- = help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`:
30- `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
31- `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
32- `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
33- `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
34+ help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`
35+ --> src/impl_/extract_argument.rs
36+ |
37+ | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false>
38+ | | for &'holder Bound<'py, T>
39+ | | where
40+ | | T: PyTypeCheck,
41+ | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
42+ ...
43+ | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option<T>
44+ | | where
45+ | | T: PyFunctionArgument<'a, 'holder, 'py, false>,
46+ | |___________________________________________________^ `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
47+ ...
48+ | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T {
49+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
50+ ...
51+ | / impl<'a, 'holder, T: PyClass<Frozen = False>> PyFunctionArgument<'a, 'holder, '_, false>
52+ | | for &'holder mut T
53+ | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
3454 = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>`
3555 = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>`
3656note: required by a bound in `extract_argument`
@@ -50,11 +70,26 @@ error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument
5070 |
5171 = note: implement `FromPyObject` to enable using `AtomicPtr<()>` as a function argument
5272 = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
53- = help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`:
54- `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
55- `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
56- `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
57- `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
73+ help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`
74+ --> src/impl_/extract_argument.rs
75+ |
76+ | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false>
77+ | | for &'holder Bound<'py, T>
78+ | | where
79+ | | T: PyTypeCheck,
80+ | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
81+ ...
82+ | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option<T>
83+ | | where
84+ | | T: PyFunctionArgument<'a, 'holder, 'py, false>,
85+ | |___________________________________________________^ `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
86+ ...
87+ | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T {
88+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
89+ ...
90+ | / impl<'a, 'holder, T: PyClass<Frozen = False>> PyFunctionArgument<'a, 'holder, '_, false>
91+ | | for &'holder mut T
92+ | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
5893 = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>`
5994 = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>`
6095note: required by a bound in `extract_argument`
@@ -79,11 +114,26 @@ help: the trait `ExtractPyClassWithClone` is not implemented for `Foo`
79114 | ^^^^^^^^^^
80115 = note: implement `FromPyObject` to enable using `Foo` as a function argument
81116 = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]`
82- = help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`:
83- `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
84- `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
85- `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
86- `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
117+ help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>`
118+ --> src/impl_/extract_argument.rs
119+ |
120+ | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false>
121+ | | for &'holder Bound<'py, T>
122+ | | where
123+ | | T: PyTypeCheck,
124+ | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
125+ ...
126+ | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option<T>
127+ | | where
128+ | | T: PyFunctionArgument<'a, 'holder, 'py, false>,
129+ | |___________________________________________________^ `Option<T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>`
130+ ...
131+ | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T {
132+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
133+ ...
134+ | / impl<'a, 'holder, T: PyClass<Frozen = False>> PyFunctionArgument<'a, 'holder, '_, false>
135+ | | for &'holder mut T
136+ | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>`
87137 = note: required for `Foo` to implement `FromPyObject<'_, '_>`
88138 = note: required for `Foo` to implement `PyFunctionArgument<'_, '_, '_, true>`
89139note: required by a bound in `extract_argument`
0 commit comments