Fix compiling net::udp::UdpSocket doctest with Rust 1.71

epel9 imports/e9/rust-mio0.7-0.7.14-6.el9
Fabio Valentini 2 years ago
parent 400c28a56f
commit 83c921c8f6
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

@ -0,0 +1,31 @@
From a09c71a8c1a4fcf992606dedc65cd2a50e90fdee Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Sun, 23 Jul 2023 22:56:50 +0200
Subject: [PATCH] Fix compiling net::udp::UdpSocket doctest with Rust 1.71
With Rust 1.71 this doctest fails to compile because of a new
`dropping_copy_types` warning, which is elevated to a hard
error because of "deny(warnings)".
This PR changes the doctest from calling "drop(buffer)"
to using the "assign to underscore to drop" trick.
---
src/net/udp.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/net/udp.rs b/src/net/udp.rs
index c5c3ba9..a750da1 100644
--- a/src/net/udp.rs
+++ b/src/net/udp.rs
@@ -79,7 +79,7 @@ use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}
/// let num_recv = echoer_socket.recv(&mut buffer)?;
/// println!("echo {:?} -> {:?}", buffer, num_recv);
/// buffer = [0; 9];
-/// # drop(buffer); // Silence unused assignment warning.
+/// # let _ = buffer; // Silence unused assignment warning.
/// # return Ok(());
/// }
/// _ => unreachable!()
--
2.41.0

@ -14,6 +14,8 @@ URL: https://crates.io/crates/mio
Source: %{crates_source}
# Automatically generated patch to strip foreign dependencies
Patch: mio-fix-metadata-auto.diff
# https://github.com/tokio-rs/mio/pull/1693
Patch: 0001-Fix-compiling-net-udp-UdpSocket-doctest-with-Rust-1..patch
BuildRequires: rust-packaging >= 21

Loading…
Cancel
Save