diff --git a/CHANGELOG.md b/CHANGELOG.md index bc60d254c6b..37c775d2790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## 0.3.0 (unreleased) +## 0.3.1 + +* Fixed scoping bug in pyobject_native_type that would break rust-numpy + +## 0.3.0 * Upgraded to syn 0.14 which means much better error messages :tada: * 128 bit integer support by [kngwyu](https://github.com/kngwyu) ([#137](https://github.com/PyO3/pyo3/pull/173)) diff --git a/src/objects/mod.rs b/src/objects/mod.rs index dedb48acf0f..363f2e273de 100644 --- a/src/objects/mod.rs +++ b/src/objects/mod.rs @@ -44,7 +44,7 @@ macro_rules! pyobject_downcast( { unsafe { if $checkfunction(ob.as_ptr()) != 0 { - Ok(&*(ob as *const $crate::objects::PyObjectRef as *const $name)) + Ok(&*(ob as *const $crate::PyObjectRef as *const $name)) } else { Err($crate::PyDowncastError.into()) } @@ -62,7 +62,7 @@ macro_rules! pyobject_native_type_named( impl ::std::convert::AsRef<$crate::PyObjectRef> for $name { #[cfg_attr(feature = "cargo-clippy", allow(useless_transmute))] fn as_ref(&self) -> &$crate::PyObjectRef { - unsafe{&*(self as *const $name as *const $crate::objects::PyObjectRef)} + unsafe{&*(self as *const $name as *const $crate::PyObjectRef)} } } @@ -99,7 +99,7 @@ macro_rules! pyobject_native_type( impl<'a> ::std::convert::From<&'a $name> for &'a $crate::PyObjectRef { fn from(ob: &'a $name) -> Self { - unsafe{&*(ob as *const $name as *const $crate::objects::PyObjectRef)} + unsafe{&*(ob as *const $name as *const $crate::PyObjectRef)} } } };