Skip to content

Commit c445e46

Browse files
authored
tokio: bump MSRV to 1.63 (#5887)
1 parent a58beb3 commit c445e46

File tree

114 files changed

+275
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+275
-474
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
# - tokio-util/Cargo.toml
2626
# - tokio-test/Cargo.toml
2727
# - tokio-stream/Cargo.toml
28-
rust_min: 1.56.0
28+
rust_min: 1.63.0
2929

3030
defaults:
3131
run:

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,13 @@ When updating this, also update:
187187

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

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

195-
* 1.27 to now - Rust 1.56
195+
* 1.30 to now - Rust 1.63
196+
* 1.27 to 1.29 - Rust 1.56
196197
* 1.17 to 1.26 - Rust 1.49
197198
* 1.15 to 1.16 - Rust 1.46
198199
* 1.0 to 1.14 - Rust 1.45

tokio/Cargo.toml

+7-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "tokio"
88
# - Create "v1.x.y" git tag.
99
version = "1.29.1"
1010
edition = "2021"
11-
rust-version = "1.56"
11+
rust-version = "1.63"
1212
authors = ["Tokio Contributors <[email protected]>"]
1313
license = "MIT"
1414
readme = "README.md"
@@ -93,9 +93,6 @@ time = []
9393
# a few releases.
9494
stats = []
9595

96-
[build-dependencies]
97-
autocfg = "1.1"
98-
9996
[dependencies]
10097
tokio-macros = { version = "~2.1.0", path = "../tokio-macros", optional = true }
10198

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

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

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

149-
[target.'cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))'.dev-dependencies]
150-
socket2 = "0.4.9"
146+
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
147+
socket2 = "0.5.3"
151148
tempfile = "3.1.0"
152149

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

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

159156
[target.'cfg(target_os = "freebsd")'.dev-dependencies]

tokio/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,13 @@ When updating this, also update:
187187

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

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

195-
* 1.27 to now - Rust 1.56
195+
* 1.30 to now - Rust 1.63
196+
* 1.27 to 1.29 - Rust 1.56
196197
* 1.17 to 1.26 - Rust 1.49
197198
* 1.15 to 1.16 - Rust 1.46
198199
* 1.0 to 1.14 - Rust 1.45

tokio/build.rs

-192
This file was deleted.

tokio/src/io/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ cfg_io_driver_impl! {
223223
pub use ready::Ready;
224224
}
225225

226-
#[cfg_attr(tokio_wasi, allow(unused_imports))]
226+
#[cfg_attr(target_os = "wasi", allow(unused_imports))]
227227
mod poll_evented;
228228

229229
#[cfg(not(loom))]
230-
#[cfg_attr(tokio_wasi, allow(unused_imports))]
230+
#[cfg_attr(target_os = "wasi", allow(unused_imports))]
231231
pub(crate) use poll_evented::PollEvented;
232232
}
233233

tokio/src/lib.rs

+1-18
Original file line numberDiff line numberDiff line change
@@ -456,26 +456,9 @@ compile_error! {
456456
"Tokio requires the platform pointer width to be 32, 64, or 128 bits"
457457
}
458458

459-
// Ensure that our build script has correctly set cfg flags for wasm.
460-
//
461-
// Each condition is written all(a, not(b)). This should be read as
462-
// "if a, then we must also have b".
463-
#[cfg(any(
464-
all(target_arch = "wasm32", not(tokio_wasm)),
465-
all(target_arch = "wasm64", not(tokio_wasm)),
466-
all(target_family = "wasm", not(tokio_wasm)),
467-
all(target_os = "wasi", not(tokio_wasm)),
468-
all(target_os = "wasi", not(tokio_wasi)),
469-
all(target_os = "wasi", tokio_wasm_not_wasi),
470-
all(tokio_wasm, not(any(target_arch = "wasm32", target_arch = "wasm64"))),
471-
all(tokio_wasm_not_wasi, not(tokio_wasm)),
472-
all(tokio_wasi, not(tokio_wasm))
473-
))]
474-
compile_error!("Tokio's build script has incorrectly detected wasm.");
475-
476459
#[cfg(all(
477460
not(tokio_unstable),
478-
tokio_wasm,
461+
target_family = "wasm",
479462
any(
480463
feature = "fs",
481464
feature = "io-std",

tokio/src/macros/cfg.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ macro_rules! cfg_fs {
8585
($($item:item)*) => {
8686
$(
8787
#[cfg(feature = "fs")]
88-
#[cfg(not(tokio_wasi))]
88+
#[cfg(not(target_os = "wasi"))]
8989
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
9090
$item
9191
)*
@@ -276,7 +276,7 @@ macro_rules! cfg_process {
276276
#[cfg(feature = "process")]
277277
#[cfg_attr(docsrs, doc(cfg(feature = "process")))]
278278
#[cfg(not(loom))]
279-
#[cfg(not(tokio_wasi))]
279+
#[cfg(not(target_os = "wasi"))]
280280
$item
281281
)*
282282
}
@@ -305,7 +305,7 @@ macro_rules! cfg_signal {
305305
#[cfg(feature = "signal")]
306306
#[cfg_attr(docsrs, doc(cfg(feature = "signal")))]
307307
#[cfg(not(loom))]
308-
#[cfg(not(tokio_wasi))]
308+
#[cfg(not(target_os = "wasi"))]
309309
$item
310310
)*
311311
}
@@ -372,7 +372,7 @@ macro_rules! cfg_not_rt {
372372
macro_rules! cfg_rt_multi_thread {
373373
($($item:item)*) => {
374374
$(
375-
#[cfg(all(feature = "rt-multi-thread", not(tokio_wasi)))]
375+
#[cfg(all(feature = "rt-multi-thread", not(target_os = "wasi")))]
376376
#[cfg_attr(docsrs, doc(cfg(feature = "rt-multi-thread")))]
377377
$item
378378
)*
@@ -585,7 +585,7 @@ macro_rules! cfg_not_has_const_mutex_new {
585585
macro_rules! cfg_not_wasi {
586586
($($item:item)*) => {
587587
$(
588-
#[cfg(not(tokio_wasi))]
588+
#[cfg(not(target_os = "wasi"))]
589589
$item
590590
)*
591591
}
@@ -594,7 +594,7 @@ macro_rules! cfg_not_wasi {
594594
macro_rules! cfg_is_wasm_not_wasi {
595595
($($item:item)*) => {
596596
$(
597-
#[cfg(tokio_wasm_not_wasi)]
597+
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
598598
$item
599599
)*
600600
}

tokio/src/net/tcp/listener.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl TcpListener {
281281
.map(|raw_socket| unsafe { std::net::TcpListener::from_raw_socket(raw_socket) })
282282
}
283283

284-
#[cfg(tokio_wasi)]
284+
#[cfg(target_os = "wasi")]
285285
{
286286
use std::os::wasi::io::{FromRawFd, IntoRawFd};
287287
self.io
@@ -416,7 +416,7 @@ mod sys {
416416
}
417417

418418
cfg_unstable! {
419-
#[cfg(tokio_wasi)]
419+
#[cfg(target_os = "wasi")]
420420
mod sys {
421421
use super::TcpListener;
422422
use std::os::wasi::prelude::*;

0 commit comments

Comments
 (0)