Skip to content

Commit

Permalink
Merge pull request #1697 from scalexm/lifetime
Browse files Browse the repository at this point in the history
Use explicit lifetimes in proc-macro expansion
  • Loading branch information
messense authored Jun 25, 2021
2 parents e8b9a99 + 53773d5 commit e16bc16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyo3-macros-backend/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ fn impl_arg_param(
let (target_ty, borrow_tmp) = if arg.optional.is_some() {
// 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() {
quote_arg_span! { _tmp.as_deref_mut() }
} else {
Expand All @@ -273,7 +273,7 @@ fn impl_arg_param(
} else {
// 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 },
)
};
Expand Down
4 changes: 2 additions & 2 deletions pyo3-macros-backend/src/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ fn impl_class(
quote! {
impl pyo3::class::impl_::PyClassWithFreeList for #cls {
#[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 _;
unsafe {
if FREELIST.is_null() {
Expand Down Expand Up @@ -503,7 +503,7 @@ fn impl_class(
const MODULE: Option<&'static str> = #module;

#[inline]
fn type_object_raw(py: pyo3::Python) -> *mut pyo3::ffi::PyTypeObject {
fn type_object_raw(py: pyo3::Python<'_>) -> *mut pyo3::ffi::PyTypeObject {
#deprecations

use pyo3::type_object::LazyStaticType;
Expand Down

1 comment on commit e16bc16

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'pyo3-bench'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e16bc16 Previous: e8b9a99 Ratio
iter_tuple 1809822 ns/iter (± 329116) 805696 ns/iter (± 2648) 2.25

This comment was automatically generated by workflow using github-action-benchmark.

CC: @PyO3/pyo3

Please sign in to comment.