From 82697bfec08afe20bfd0e0cefff70cc930595809 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 14 Jul 2021 23:38:08 -0400 Subject: [PATCH 1/2] workaround an issue that causes function arguments to show up as if they are uncovered https://github.com/rust-lang/rust/issues/86972 describes this issue in some detail and links to a minimal reproducer making this change, and this change alone, resolves the coverage issues --- pyo3-macros-backend/src/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyo3-macros-backend/src/params.rs b/pyo3-macros-backend/src/params.rs index 7e3a39c3886..e283749bbcd 100644 --- a/pyo3-macros-backend/src/params.rs +++ b/pyo3-macros-backend/src/params.rs @@ -208,7 +208,7 @@ fn impl_arg_param( let ty = arg.ty; let name = arg.name; - let transform_error = quote_arg_span! { + let transform_error = quote! { |e| pyo3::derive_utils::argument_extraction_error(#py, stringify!(#name), e) }; From a941b2c65fa5a642add46a31fc723d06b1383eae Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 15 Jul 2021 07:14:44 -0400 Subject: [PATCH 2/2] Added a changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0c0abbcbbe..f24b3cd3e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fix regression in 0.14.0 rejecting usage of `#[doc(hidden)]` on structs and functions annotated with PyO3 macros. [#1722](https://github.com/PyO3/pyo3/pull/1722) +- Fix regression in 0.14.0 leading to incorrect code coverage being computed for `#[pyfunction]`s. [#1726](https://github.com/PyO3/pyo3/pull/1726) ## [0.14.1] - 2021-07-04