You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
silence deprecation warning for enum with custom __eq__ (#4692)
* silence deprecation warning for enum with custom `__eq__`
* clippy
* also support `__richcmp__`
* fix ci
---------
Co-authored-by: Icxolu <[email protected]>
Copy file name to clipboardExpand all lines: tests/ui/deprecations.stderr
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ error: use of deprecated constant `__pyfunction_pyfunction_option_4::SIGNATURE`:
28
28
21 | fn pyfunction_option_4(
29
29
| ^^^^^^^^^^^^^^^^^^^
30
30
31
-
error: use of deprecated constant `SimpleEnumWithoutEq::__pyo3__generated____richcmp__::DEPRECATION`: Implicit equality for simple enums is deprecated. Use `#[pyclass(eq, eq_int)]` to keep the current behavior.
31
+
error: use of deprecated method `pyo3::impl_::pyclass::Deprecation::autogenerated_equality`: Implicit equality for simple enums is deprecated. Use `#[pyclass(eq, eq_int)]` to keep the current behavior.
Copy file name to clipboardExpand all lines: tests/ui/invalid_proto_pymethods.stderr
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,17 @@ note: candidate #2 is defined in an impl for the type `EqAndRichcmp`
40
40
| ^^^^^^^^^^^^
41
41
= note: this error originates in the macro `::pyo3::impl_::pyclass::generate_pyclass_richcompare_slot` which comes from the expansion of the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
42
42
43
+
error[E0119]: conflicting implementations of trait `HasCustomRichCmp` for type `EqAndRichcmp`
44
+
--> tests/ui/invalid_proto_pymethods.rs:55:1
45
+
|
46
+
55 | #[pymethods]
47
+
| ^^^^^^^^^^^^
48
+
| |
49
+
| first implementation here
50
+
| conflicting implementation for `EqAndRichcmp`
51
+
|
52
+
= note: this error originates in the macro `::pyo3::impl_::pyclass::generate_pyclass_richcompare_slot` which comes from the expansion of the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
53
+
43
54
error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
0 commit comments