diff --git a/0ac338b.patch b/0ac338b.patch new file mode 100644 index 0000000..1819769 --- /dev/null +++ b/0ac338b.patch @@ -0,0 +1,46 @@ +From 0ac338b74445bf55ffd70d6bc85f4339d151f6fc Mon Sep 17 00:00:00 2001 +From: Alex Rawson +Date: Tue, 31 May 2022 17:51:45 -0500 +Subject: [PATCH] Ignore doctests for unexported macros + +Due to rust-lang/rust#97030, cargo test will fail to doctest macros +unless they are exported, breaking the examples for libc_bitflags! and +libc_enum!. + +Adds `ignore` to the examples for these macros to stop tests from +failing. +--- + src/macros.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/macros.rs b/src/macros.rs +index 018534fa67..99e0de8866 100644 +--- a/src/macros.rs ++++ b/src/macros.rs +@@ -19,7 +19,7 @@ macro_rules! feature { + /// The `libc` crate must be in scope with the name `libc`. + /// + /// # Example +-/// ``` ++/// ```ignore + /// libc_bitflags!{ + /// pub struct ProtFlags: libc::c_int { + /// PROT_NONE; +@@ -39,7 +39,7 @@ macro_rules! feature { + /// various flags have different types, so we cast the broken ones to the right + /// type. + /// +-/// ``` ++/// ```ignore + /// libc_bitflags!{ + /// pub struct SaFlags: libc::c_ulong { + /// SA_NOCLDSTOP as libc::c_ulong; +@@ -80,7 +80,7 @@ macro_rules! libc_bitflags { + /// The `libc` crate must be in scope with the name `libc`. + /// + /// # Example +-/// ``` ++/// ```ignore + /// libc_enum!{ + /// pub enum ProtFlags { + /// PROT_NONE, diff --git a/rust-nix0.23.spec b/rust-nix0.23.spec index 0f8aa75..feab67b 100644 --- a/rust-nix0.23.spec +++ b/rust-nix0.23.spec @@ -17,6 +17,9 @@ Source: %{crates_source} # * drop DragonflyBSD/FreeBSD-specific dependencies Patch0: nix-fix-metadata.diff +# * upstream patch to fix doctests with Rust 1.62+ +Patch1: https://github.com/nix-rust/nix/commit/0ac338b.patch + ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging >= 21