From a09c71a8c1a4fcf992606dedc65cd2a50e90fdee Mon Sep 17 00:00:00 2001 From: Fabio Valentini 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