From d6ea7a742b92d3e516035a584ab9347a96be363a Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 14 Jan 2023 04:58:34 +0900 Subject: [PATCH 1/2] 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 8258a0f7a..a3aa9d60c 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); From 171ce0ff8d38b87a39c1e6a16fedc9a2373720e0 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 17 Jan 2023 23:00:38 +0900 Subject: [PATCH 2/2] chore: prepare Tokio v1.18.5 release --- README.md | 2 +- tokio/CHANGELOG.md | 10 +++++++++- tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ef20ec0b..46b1e089c 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.4", features = ["full"] } +tokio = { version = "1.18.5", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 8652e4a0e..05f4d8152 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,11 @@ +# 1.18.5 (January 17, 2023) + +### Fixed + +- io: fix unsoundness in `ReadHalf::unsplit` ([#5375]) + +[#5375]: https://github.com/tokio-rs/tokio/pull/5375 + # 1.18.4 (January 3, 2022) ### Fixed @@ -136,7 +144,7 @@ performance improvements. - time: use bit manipulation instead of modulo to improve performance ([#4480]) - net: use `std::future::Ready` instead of our own `Ready` future ([#4271]) - replace deprecated `atomic::spin_loop_hint` with `hint::spin_loop` ([#4491]) -- fix miri failures in intrusive linked lists ([#4397]) +- fix miri failures in intrusive linked lists ([#4397]) ### Documented diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 42beeb73d..3e6b95784 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.18.4" +version = "1.18.5" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 0ef20ec0b..46b1e089c 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.4", features = ["full"] } +tokio = { version = "1.18.5", features = ["full"] } ``` Then, on your main.rs: