From 2d49dc33b72958ecefe31300a9db095b99a41a64 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Wed, 8 Dec 2021 14:22:54 +0100 Subject: [PATCH] Fix the `#[macro_export]` absolute path within the same crate issue --- pyo3-macros-backend/src/pyimpl.rs | 2 +- src/class/impl_.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyo3-macros-backend/src/pyimpl.rs b/pyo3-macros-backend/src/pyimpl.rs index 72320f1e..3790a4d0 100644 --- a/pyo3-macros-backend/src/pyimpl.rs +++ b/pyo3-macros-backend/src/pyimpl.rs @@ -266,7 +266,7 @@ fn add_shared_proto_slots( let first_implemented = implemented_proto_fragments.remove($first); let second_implemented = implemented_proto_fragments.remove($second); if first_implemented || second_implemented { - proto_impls.push(quote! { _pyo3::$slot!(#ty) }) + proto_impls.push(quote! { _pyo3::class::impl_::$slot!(#ty) }) } }}; } diff --git a/src/class/impl_.rs b/src/class/impl_.rs index 0ab37e2a..7f1488a6 100644 --- a/src/class/impl_.rs +++ b/src/class/impl_.rs @@ -183,6 +183,7 @@ macro_rules! define_pyclass_setattr_slot { } }}; } + pub use $generate_macro; }; } @@ -292,6 +293,7 @@ macro_rules! define_pyclass_binary_operator_slot { } }}; } + pub use $generate_macro; }; } @@ -484,6 +486,7 @@ macro_rules! generate_pyclass_pow_slot { } }}; } +pub use generate_pyclass_pow_slot; pub trait PyClassAllocImpl { fn alloc_impl(self) -> Option;