Skip to content

Commit

Permalink
tokio: bump MSRV to 1.63 (#5887)
Browse files Browse the repository at this point in the history
  • Loading branch information
NobodyXu authored Jul 27, 2023
1 parent a58beb3 commit c445e46
Show file tree
Hide file tree
Showing 114 changed files with 275 additions and 474 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
# - tokio-util/Cargo.toml
# - tokio-test/Cargo.toml
# - tokio-stream/Cargo.toml
rust_min: 1.56.0
rust_min: 1.63.0

defaults:
run:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ When updating this, also update:

Tokio will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.56.0.
released at least six months ago. The current MSRV is 1.63.

Note that the MSRV is not increased automatically, and only as part of a minor
release. The MSRV history for past minor releases can be found below:

* 1.27 to now - Rust 1.56
* 1.30 to now - Rust 1.63
* 1.27 to 1.29 - Rust 1.56
* 1.17 to 1.26 - Rust 1.49
* 1.15 to 1.16 - Rust 1.46
* 1.0 to 1.14 - Rust 1.45
Expand Down
17 changes: 7 additions & 10 deletions tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "tokio"
# - Create "v1.x.y" git tag.
version = "1.29.1"
edition = "2021"
rust-version = "1.56"
rust-version = "1.63"
authors = ["Tokio Contributors <team@tokio.rs>"]
license = "MIT"
readme = "README.md"
Expand Down Expand Up @@ -93,9 +93,6 @@ time = []
# a few releases.
stats = []

[build-dependencies]
autocfg = "1.1"

[dependencies]
tokio-macros = { version = "~2.1.0", path = "../tokio-macros", optional = true }

Expand All @@ -107,8 +104,8 @@ mio = { version = "0.8.6", optional = true, default-features = false }
num_cpus = { version = "1.8.0", optional = true }
parking_lot = { version = "0.12.0", optional = true }

[target.'cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))'.dependencies]
socket2 = { version = "0.4.9", optional = true, features = [ "all" ] }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
socket2 = { version = "0.5.3", optional = true, features = [ "all" ] }

# Currently unstable. The API exposed by these features may be broken at any time.
# Requires `--cfg tokio_unstable` to enable.
Expand Down Expand Up @@ -146,14 +143,14 @@ futures = { version = "0.3.0", features = ["async-await"] }
mockall = "0.11.1"
async-stream = "0.3"

[target.'cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))'.dev-dependencies]
socket2 = "0.4.9"
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
socket2 = "0.5.3"
tempfile = "3.1.0"

[target.'cfg(not(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown")))'.dev-dependencies]
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies]
rand = "0.8.0"

[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_os = "wasi")))'.dev-dependencies]
[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies]
wasm-bindgen-test = "0.3.0"

[target.'cfg(target_os = "freebsd")'.dev-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions tokio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ When updating this, also update:

Tokio will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.56.0.
released at least six months ago. The current MSRV is 1.63.

Note that the MSRV is not increased automatically, and only as part of a minor
release. The MSRV history for past minor releases can be found below:

* 1.27 to now - Rust 1.56
* 1.30 to now - Rust 1.63
* 1.27 to 1.29 - Rust 1.56
* 1.17 to 1.26 - Rust 1.49
* 1.15 to 1.16 - Rust 1.46
* 1.0 to 1.14 - Rust 1.45
Expand Down
192 changes: 0 additions & 192 deletions tokio/build.rs

This file was deleted.

4 changes: 2 additions & 2 deletions tokio/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ cfg_io_driver_impl! {
pub use ready::Ready;
}

#[cfg_attr(tokio_wasi, allow(unused_imports))]
#[cfg_attr(target_os = "wasi", allow(unused_imports))]
mod poll_evented;

#[cfg(not(loom))]
#[cfg_attr(tokio_wasi, allow(unused_imports))]
#[cfg_attr(target_os = "wasi", allow(unused_imports))]
pub(crate) use poll_evented::PollEvented;
}

Expand Down
19 changes: 1 addition & 18 deletions tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,26 +456,9 @@ compile_error! {
"Tokio requires the platform pointer width to be 32, 64, or 128 bits"
}

// Ensure that our build script has correctly set cfg flags for wasm.
//
// Each condition is written all(a, not(b)). This should be read as
// "if a, then we must also have b".
#[cfg(any(
all(target_arch = "wasm32", not(tokio_wasm)),
all(target_arch = "wasm64", not(tokio_wasm)),
all(target_family = "wasm", not(tokio_wasm)),
all(target_os = "wasi", not(tokio_wasm)),
all(target_os = "wasi", not(tokio_wasi)),
all(target_os = "wasi", tokio_wasm_not_wasi),
all(tokio_wasm, not(any(target_arch = "wasm32", target_arch = "wasm64"))),
all(tokio_wasm_not_wasi, not(tokio_wasm)),
all(tokio_wasi, not(tokio_wasm))
))]
compile_error!("Tokio's build script has incorrectly detected wasm.");

#[cfg(all(
not(tokio_unstable),
tokio_wasm,
target_family = "wasm",
any(
feature = "fs",
feature = "io-std",
Expand Down
12 changes: 6 additions & 6 deletions tokio/src/macros/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ macro_rules! cfg_fs {
($($item:item)*) => {
$(
#[cfg(feature = "fs")]
#[cfg(not(tokio_wasi))]
#[cfg(not(target_os = "wasi"))]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
$item
)*
Expand Down Expand Up @@ -276,7 +276,7 @@ macro_rules! cfg_process {
#[cfg(feature = "process")]
#[cfg_attr(docsrs, doc(cfg(feature = "process")))]
#[cfg(not(loom))]
#[cfg(not(tokio_wasi))]
#[cfg(not(target_os = "wasi"))]
$item
)*
}
Expand Down Expand Up @@ -305,7 +305,7 @@ macro_rules! cfg_signal {
#[cfg(feature = "signal")]
#[cfg_attr(docsrs, doc(cfg(feature = "signal")))]
#[cfg(not(loom))]
#[cfg(not(tokio_wasi))]
#[cfg(not(target_os = "wasi"))]
$item
)*
}
Expand Down Expand Up @@ -372,7 +372,7 @@ macro_rules! cfg_not_rt {
macro_rules! cfg_rt_multi_thread {
($($item:item)*) => {
$(
#[cfg(all(feature = "rt-multi-thread", not(tokio_wasi)))]
#[cfg(all(feature = "rt-multi-thread", not(target_os = "wasi")))]
#[cfg_attr(docsrs, doc(cfg(feature = "rt-multi-thread")))]
$item
)*
Expand Down Expand Up @@ -585,7 +585,7 @@ macro_rules! cfg_not_has_const_mutex_new {
macro_rules! cfg_not_wasi {
($($item:item)*) => {
$(
#[cfg(not(tokio_wasi))]
#[cfg(not(target_os = "wasi"))]
$item
)*
}
Expand All @@ -594,7 +594,7 @@ macro_rules! cfg_not_wasi {
macro_rules! cfg_is_wasm_not_wasi {
($($item:item)*) => {
$(
#[cfg(tokio_wasm_not_wasi)]
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
$item
)*
}
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/net/tcp/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl TcpListener {
.map(|raw_socket| unsafe { std::net::TcpListener::from_raw_socket(raw_socket) })
}

#[cfg(tokio_wasi)]
#[cfg(target_os = "wasi")]
{
use std::os::wasi::io::{FromRawFd, IntoRawFd};
self.io
Expand Down Expand Up @@ -416,7 +416,7 @@ mod sys {
}

cfg_unstable! {
#[cfg(tokio_wasi)]
#[cfg(target_os = "wasi")]
mod sys {
use super::TcpListener;
use std::os::wasi::prelude::*;
Expand Down
Loading

0 comments on commit c445e46

Please sign in to comment.