From d6ea7a742b92d3e516035a584ab9347a96be363a Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 14 Jan 2023 04:58:34 +0900 Subject: [PATCH] Add `T: Unpin` bound to ReadHalf::unsplit --- tokio/src/io/split.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tokio/src/io/split.rs b/tokio/src/io/split.rs index 8258a0f7a08..a3aa9d60c07 100644 --- a/tokio/src/io/split.rs +++ b/tokio/src/io/split.rs @@ -74,7 +74,10 @@ impl ReadHalf { /// same `split` operation this method will panic. /// This can be checked ahead of time by comparing the stream ID /// of the two halves. - pub fn unsplit(self, wr: WriteHalf) -> T { + pub fn unsplit(self, wr: WriteHalf) -> T + where + T: Unpin, + { if self.is_pair_of(&wr) { drop(wr);