Use explicit lifetimes in proc-macro expansion

This commit is contained in:
scalexm 2021-06-25 00:02:21 +02:00
parent e8b9a991d3
commit 53773d5484
2 changed files with 4 additions and 4 deletions

View file

@ -263,7 +263,7 @@ fn impl_arg_param(
let (target_ty, borrow_tmp) = if arg.optional.is_some() { let (target_ty, borrow_tmp) = if arg.optional.is_some() {
// Get Option<&T> from Option<PyRef<T>> // Get Option<&T> from Option<PyRef<T>>
( (
quote_arg_span! { Option<<#tref as pyo3::derive_utils::ExtractExt>::Target> }, quote_arg_span! { Option<<#tref as pyo3::derive_utils::ExtractExt<'_>>::Target> },
if mut_.is_some() { if mut_.is_some() {
quote_arg_span! { _tmp.as_deref_mut() } quote_arg_span! { _tmp.as_deref_mut() }
} else { } else {
@ -273,7 +273,7 @@ fn impl_arg_param(
} else { } else {
// Get &T from PyRef<T> // Get &T from PyRef<T>
( (
quote_arg_span! { <#tref as pyo3::derive_utils::ExtractExt>::Target }, quote_arg_span! { <#tref as pyo3::derive_utils::ExtractExt<'_>>::Target },
quote_arg_span! { &#mut_ *_tmp }, quote_arg_span! { &#mut_ *_tmp },
) )
}; };

View file

@ -382,7 +382,7 @@ fn impl_class(
quote! { quote! {
impl pyo3::class::impl_::PyClassWithFreeList for #cls { impl pyo3::class::impl_::PyClassWithFreeList for #cls {
#[inline] #[inline]
fn get_free_list(_py: pyo3::Python) -> &mut pyo3::impl_::freelist::FreeList<*mut pyo3::ffi::PyObject> { fn get_free_list(_py: pyo3::Python<'_>) -> &mut pyo3::impl_::freelist::FreeList<*mut pyo3::ffi::PyObject> {
static mut FREELIST: *mut pyo3::impl_::freelist::FreeList<*mut pyo3::ffi::PyObject> = 0 as *mut _; static mut FREELIST: *mut pyo3::impl_::freelist::FreeList<*mut pyo3::ffi::PyObject> = 0 as *mut _;
unsafe { unsafe {
if FREELIST.is_null() { if FREELIST.is_null() {
@ -503,7 +503,7 @@ fn impl_class(
const MODULE: Option<&'static str> = #module; const MODULE: Option<&'static str> = #module;
#[inline] #[inline]
fn type_object_raw(py: pyo3::Python) -> *mut pyo3::ffi::PyTypeObject { fn type_object_raw(py: pyo3::Python<'_>) -> *mut pyo3::ffi::PyTypeObject {
#deprecations #deprecations
use pyo3::type_object::LazyStaticType; use pyo3::type_object::LazyStaticType;