From 33916d2336f5015edcded834ecaabf4b0fc485c6 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Sat, 22 Jul 2023 22:46:26 -0700 Subject: [PATCH] vector: compatibility with rust 1.71 --- pkgs/tools/misc/vector/default.nix | 4 ++++ .../vector/rust-1.71-unnecessary-mut.diff | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/tools/misc/vector/rust-1.71-unnecessary-mut.diff diff --git a/pkgs/tools/misc/vector/default.nix b/pkgs/tools/misc/vector/default.nix index a1d56481ab83..b74bd1c9e3cd 100644 --- a/pkgs/tools/misc/vector/default.nix +++ b/pkgs/tools/misc/vector/default.nix @@ -45,6 +45,10 @@ rustPlatform.buildRustPackage { hash = "sha256-+ATOHx+LQLQV4nMdj1FRRvDTqGCTbX9kl290AbY9Vw0="; }; + patches = [ + ./rust-1.71-unnecessary-mut.diff + ]; + cargoLock = { lockFile = ./Cargo.lock; outputHashes = { diff --git a/pkgs/tools/misc/vector/rust-1.71-unnecessary-mut.diff b/pkgs/tools/misc/vector/rust-1.71-unnecessary-mut.diff new file mode 100644 index 000000000000..2507117279ba --- /dev/null +++ b/pkgs/tools/misc/vector/rust-1.71-unnecessary-mut.diff @@ -0,0 +1,22 @@ +diff --git a/lib/vector-core/src/tls/incoming.rs b/lib/vector-core/src/tls/incoming.rs +index 5d2fd1cdb..7992f2c2b 100644 +--- a/lib/vector-core/src/tls/incoming.rs ++++ b/lib/vector-core/src/tls/incoming.rs +@@ -263,7 +263,7 @@ impl MaybeTlsIncomingStream { + where + F: FnOnce(Pin<&mut MaybeTlsStream>, &mut Context) -> Poll>, + { +- let mut this = self.get_mut(); ++ let this = self.get_mut(); + loop { + return match &mut this.state { + StreamState::Accepted(stream) => poll_fn(Pin::new(stream), cx), +@@ -307,7 +307,7 @@ impl AsyncWrite for MaybeTlsIncomingStream { + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { +- let mut this = self.get_mut(); ++ let this = self.get_mut(); + match &mut this.state { + StreamState::Accepted(stream) => match Pin::new(stream).poll_shutdown(cx) { + Poll::Ready(Ok(())) => {