Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Icxolu committed Nov 9, 2024
1 parent 6f15625 commit c808598
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyo3-macros-backend/src/pymethod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,10 @@ impl SlotDef {
let name = spec.name;
let holders = holders.init_holders(ctx);
let dep = if method_name == "__richcmp__" {
quote! { impl #pyo3_path::impl_::pyclass::HasCustomRichCmp for #cls {} }
quote! {
#[allow(unknown_lints, non_local_definitions)]
impl #pyo3_path::impl_::pyclass::HasCustomRichCmp for #cls {}
}
} else {
TokenStream::default()
};
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/invalid_proto_pymethods.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ note: candidate #2 is defined in an impl for the type `EqAndRichcmp`
| ^^^^^^^^^^^^
= 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)

error[E0119]: conflicting implementations of trait `HasCustomRichCmp` for type `EqAndRichcmp`
--> tests/ui/invalid_proto_pymethods.rs:55:1
|
55 | #[pymethods]
| ^^^^^^^^^^^^
| |
| first implementation here
| conflicting implementation for `EqAndRichcmp`
|
= 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)

error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
--> tests/ui/invalid_proto_pymethods.rs:55:1
|
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/invalid_pyclass_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ error: The format string syntax cannot be used with enums
171 | #[pyclass(eq, str = "Stuff...")]
| ^^^^^^^^^^

error[E0119]: conflicting implementations of trait `HasCustomRichCmp` for type `EqOptAndManualRichCmp`
--> tests/ui/invalid_pyclass_args.rs:41:1
|
37 | #[pyclass(eq)]
| -------------- first implementation here
...
41 | #[pymethods]
| ^^^^^^^^^^^^ conflicting implementation for `EqOptAndManualRichCmp`
|
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0592]: duplicate definitions with name `__pymethod___richcmp____`
--> tests/ui/invalid_pyclass_args.rs:37:1
|
Expand Down

0 comments on commit c808598

Please sign in to comment.