From 03904caab119689524011e14938e33c2f9c27237 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Fri, 5 Apr 2024 11:00:39 +0200 Subject: [PATCH] Drop deny(warnings) from doctests to fix building with recent Rust --- 0001-drop-deny-warnings-from-doctests.patch | 26 +++++++++++ ...with-missing-send_wrapper-dependency.patch | 43 ------------------- rust-pyo3.spec | 2 + 3 files changed, 28 insertions(+), 43 deletions(-) create mode 100644 0001-drop-deny-warnings-from-doctests.patch delete mode 100644 0001-ignore-doctests-with-missing-send_wrapper-dependency.patch diff --git a/0001-drop-deny-warnings-from-doctests.patch b/0001-drop-deny-warnings-from-doctests.patch new file mode 100644 index 0000000..4ce7fac --- /dev/null +++ b/0001-drop-deny-warnings-from-doctests.patch @@ -0,0 +1,26 @@ +From d4a43723777978e6fb5dca5463da3f5a548b9034 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Fri, 5 Apr 2024 10:55:47 +0200 +Subject: [PATCH] drop deny(warnings) from doctests + +--- + src/lib.rs | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/lib.rs b/src/lib.rs +index ecaaf64..c80a3bc 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -7,8 +7,7 @@ + deny( + rust_2018_idioms, + unused_lifetimes, +- rust_2021_prelude_collisions, +- warnings ++ rust_2021_prelude_collisions + ), + allow(unused_variables, unused_assignments, unused_extern_crates) + )))] +-- +2.44.0 + diff --git a/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch b/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch deleted file mode 100644 index da22aa5..0000000 --- a/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 36f1b42e44f2cd2cfc3e14b0a4ab7c5cf9904bf7 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Tue, 14 Nov 2023 00:51:33 +0100 -Subject: [PATCH] ignore doctests with missing send_wrapper dependency - ---- - src/marker.rs | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/marker.rs b/src/marker.rs -index dfe876c..1352276 100644 ---- a/src/marker.rs -+++ b/src/marker.rs -@@ -66,7 +66,7 @@ - //! This will "work" to smuggle Python references across the closure, because we're not actually - //! doing anything with threads: - //! --//! ```rust, no_run -+//! ```rust, ignore - //! use pyo3::prelude::*; - //! use pyo3::types::PyString; - //! use send_wrapper::SendWrapper; -@@ -157,7 +157,7 @@ use std::os::raw::c_int; - /// This also implies that the interplay between `with_gil` and `allow_threads` is unsound, for example - /// one can circumvent this protection using the [`send_wrapper`](https://docs.rs/send_wrapper/) crate: - /// --/// ```no_run -+/// ```ignore - /// # use pyo3::prelude::*; - /// # use pyo3::types::PyString; - /// use send_wrapper::SendWrapper; -@@ -231,7 +231,7 @@ mod nightly { - /// On nightly Rust, this is not based on the [`Send`] auto trait and hence we are able - /// to prevent incorrectly circumventing it using e.g. the [`send_wrapper`](https://docs.rs/send_wrapper/) crate: - /// -- /// ```compile_fail -+ /// ```ignore - /// # use pyo3::prelude::*; - /// # use pyo3::types::PyString; - /// use send_wrapper::SendWrapper; --- -2.41.0 - diff --git a/rust-pyo3.spec b/rust-pyo3.spec index 3ea8edb..8a442ea 100644 --- a/rust-pyo3.spec +++ b/rust-pyo3.spec @@ -16,6 +16,8 @@ Source: %{crates_source} # * bump widestring dev-dependency from 0.5 to 1.0 # * drop MSVC- and MinGW-only features Patch: pyo3-fix-metadata.diff +# drop deny(warnings) from doctests to fix building with recent Rust +Patch: 0001-drop-deny-warnings-from-doctests.patch BuildRequires: cargo-rpm-macros >= 24