Include upstream patch to fix doctests with Rust 1.62+

epel9
Fabio Valentini 3 years ago
parent 12256c2a04
commit b9bc846c94
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

@ -0,0 +1,46 @@
From 0ac338b74445bf55ffd70d6bc85f4339d151f6fc Mon Sep 17 00:00:00 2001
From: Alex Rawson <ajzecrom@gmail.com>
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,

@ -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

Loading…
Cancel
Save