Skip to content

Commit 3f66729

Browse files
committed
fix macros without $crate:: access
Some macro definitions are missing `$crate::` in their calls to other macros. Add them. Fixes #234
1 parent 4283acd commit 3f66729

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/py_class/members.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ where
131131
#[doc(hidden)]
132132
macro_rules! py_class_class_method {
133133
($py:ident, $class:ident :: $f:ident [ $( { $pname:ident : $ptype:ty = $detail:tt } )* ]) => {{
134-
py_class_class_method!($py, $class::$f, { "" } [ $( { $pname : $ptype = $detail } )* ])
134+
$crate::py_class_class_method!($py, $class::$f, { "" } [ $( { $pname : $ptype = $detail } )* ])
135135
}};
136136

137137
($py:ident, $class:ident :: $f:ident, { $doc:expr } [ $( { $pname:ident : $ptype:ty = $detail:tt } )* ]) => {{

src/py_class/slots.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ macro_rules! py_class_binary_slot {
340340
let slf =
341341
$crate::PyObject::from_borrowed_ptr(py, slf).unchecked_cast_into::<$class>();
342342
let arg = $crate::PyObject::from_borrowed_ptr(py, arg);
343-
let ret = match py_class_call_slot_impl_with_ref!(
343+
let ret = match $crate::py_class_call_slot_impl_with_ref!(
344344
py,
345345
slf,
346346
$f,
@@ -378,7 +378,7 @@ macro_rules! py_class_ternary_slot {
378378
let arg2 = $crate::PyObject::from_borrowed_ptr(py, arg2);
379379
let ret = match <$arg2_type as $crate::FromPyObject>::extract(py, &arg2) {
380380
Ok(arg2) => {
381-
match py_class_call_slot_impl_with_ref!(
381+
match $crate::py_class_call_slot_impl_with_ref!(
382382
py,
383383
slf,
384384
$f,
@@ -440,7 +440,7 @@ macro_rules! py_class_richcompare_slot {
440440
let arg = $crate::PyObject::from_borrowed_ptr(py, arg);
441441
let ret = match $crate::py_class::slots::extract_op(py, op) {
442442
Ok(op) => {
443-
match py_class_call_slot_impl_with_ref!(
443+
match $crate::py_class_call_slot_impl_with_ref!(
444444
py,
445445
slf,
446446
$f,
@@ -482,7 +482,7 @@ macro_rules! py_class_contains_slot {
482482
let slf = $crate::PyObject::from_borrowed_ptr(py, slf)
483483
.unchecked_cast_into::<$class>();
484484
let arg = $crate::PyObject::from_borrowed_ptr(py, arg);
485-
let ret = match py_class_call_slot_impl_with_ref!(
485+
let ret = match $crate::py_class_call_slot_impl_with_ref!(
486486
py,
487487
slf,
488488
$f,
@@ -750,7 +750,7 @@ macro_rules! py_class_prop_setter {
750750
slf.$f(py, None)
751751
} else {
752752
let obj = $crate::PyObject::from_borrowed_ptr(py, obj);
753-
let ret = match py_class_call_slot_impl_with_ref!(
753+
let ret = match $crate::py_class_call_slot_impl_with_ref!(
754754
py,
755755
slf,
756756
$f,
@@ -791,7 +791,7 @@ macro_rules! py_class_tp_getset {
791791
static mut GETSET: &mut [$crate::_detail::ffi::PyGetSetDef] = &mut [
792792
$($crate::_detail::ffi::PyGetSetDef {
793793
name: 0 as *mut _,
794-
get: py_class_prop_getter!($class::$getter_name),
794+
get: $crate::py_class_prop_getter!($class::$getter_name),
795795
set: None,
796796
doc: 0 as *mut _,
797797
closure: 0 as *mut _,
@@ -813,7 +813,7 @@ macro_rules! py_class_tp_getset {
813813
}
814814
)*
815815
$(
816-
GETSET[$setter_name].set = py_class_prop_setter!($class::$setter_setter, $value_type);
816+
GETSET[$setter_name].set = $crate::py_class_prop_setter!($class::$setter_setter, $value_type);
817817
)*
818818
GETSET.as_ptr() as *mut _
819819
}

0 commit comments

Comments
 (0)