From 147f7ef0891987c9633594d1bd0d612f50afba47 Mon Sep 17 00:00:00 2001 From: Icxolu <10486322+Icxolu@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:06:43 +0100 Subject: [PATCH] fix `clippy::wildcard_import` firing on `#[pyclass]` (#4707) --- pyo3-macros-backend/src/pyclass.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyo3-macros-backend/src/pyclass.rs b/pyo3-macros-backend/src/pyclass.rs index 747c0153b95..a83ba880271 100644 --- a/pyo3-macros-backend/src/pyclass.rs +++ b/pyo3-macros-backend/src/pyclass.rs @@ -2324,11 +2324,11 @@ impl<'a> PyClassImplsBuilder<'a> { let assertions = if attr.options.unsendable.is_some() { TokenStream::new() } else { - quote_spanned! { - cls.span() => + let assert = quote_spanned! { cls.span() => assert_pyclass_sync::<#cls>(); }; + quote! { const _: () = { use #pyo3_path::impl_::pyclass::*; - assert_pyclass_sync::<#cls>(); + #assert }; } };