diff --git a/newsfragments/3564.fixed.md b/newsfragments/3564.fixed.md new file mode 100644 index 00000000..83e4dba0 --- /dev/null +++ b/newsfragments/3564.fixed.md @@ -0,0 +1 @@ +Silenced new `clippy::unnecessary_fallible_conversions` warning when using a `Py` `self` receiver diff --git a/pyo3-macros-backend/src/method.rs b/pyo3-macros-backend/src/method.rs index d8d901bb..9298dab4 100644 --- a/pyo3-macros-backend/src/method.rs +++ b/pyo3-macros-backend/src/method.rs @@ -182,6 +182,7 @@ impl SelfType { .map_err(::std::convert::Into::<_pyo3::PyErr>::into) .and_then( #[allow(clippy::useless_conversion)] // In case slf is PyCell + #[allow(unknown_lints, clippy::unnecessary_fallible_conversions)] // In case slf is Py (unknown_lints can be removed when MSRV is 1.75+) |cell| ::std::convert::TryFrom::try_from(cell).map_err(::std::convert::Into::into) )