@@ -309,17 +309,14 @@ jobs:
309309 - name : test tokio full --cfg unstable --cfg taskdump
310310 run : |
311311 set -euxo pipefail
312- # taskdump is an unstable feature, but it can only be enabled
313- # by --cfg tokio_taskdump, not by a feature flag, so we can
314- # use $TOKIO_STABLE_FEATURES here.
315- cargo nextest run --features $TOKIO_STABLE_FEATURES
312+ cargo nextest run --features $TOKIO_STABLE_FEATURES,taskdump
316313 cargo test --doc --features $TOKIO_STABLE_FEATURES
317314 working-directory : tokio
318315 env :
319- RUSTFLAGS : --cfg tokio_unstable --cfg tokio_taskdump - Dwarnings
316+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings
320317 # in order to run doctests for unstable features, we must also pass
321318 # the unstable cfg to RustDoc
322- RUSTDOCFLAGS : --cfg tokio_unstable --cfg tokio_taskdump
319+ RUSTDOCFLAGS : --cfg tokio_unstable
323320
324321 check-unstable-mt-counters :
325322 name : check tokio full --internal-mt-counters
@@ -484,7 +481,7 @@ jobs:
484481
485482 - uses : Swatinem/rust-cache@v2
486483 # We don't use --all-features since io-uring will be enabled and is not supported on those targets.
487- - run : cargo check --workspace --features full,test-util --target ${{ matrix.target }}
484+ - run : cargo check --workspace --features $TOKIO_STABLE_FEATURES --target ${{ matrix.target }}
488485 env :
489486 RUSTFLAGS : --cfg tokio_unstable -Dwarnings
490487
@@ -496,8 +493,9 @@ jobs:
496493 matrix :
497494 target :
498495 - name : x86_64-unknown-haiku
496+ exclude_features : " taskdump" # taskdump is only available on Linux
499497 - name : armv7-sony-vita-newlibeabihf
500- exclude_features : " process,signal,rt-process-signal,full"
498+ exclude_features : " process,signal,rt-process-signal,full,taskdump "
501499 steps :
502500 - uses : actions/checkout@v5
503501 - name : Install Rust ${{ env.rust_nightly }}
@@ -522,14 +520,14 @@ jobs:
522520 include :
523521 - target : i686-unknown-linux-gnu
524522 os : ubuntu-latest
525- rustflags : --cfg tokio_taskdump
523+ extra_features : " taskdump "
526524 - target : armv5te-unknown-linux-gnueabi
527525 os : ubuntu-latest
528526 - target : armv7-unknown-linux-gnueabihf
529527 os : ubuntu-24.04-arm
530528 - target : aarch64-unknown-linux-gnu
531529 os : ubuntu-24.04-arm
532- rustflags : --cfg tokio_taskdump
530+ extra_features : " io-uring,taskdump "
533531 - target : aarch64-pc-windows-msvc
534532 os : windows-11-arm
535533 steps :
@@ -554,13 +552,15 @@ jobs:
554552 - name : Tests run with all features (including parking_lot)
555553 run : |
556554 set -euxo pipefail
557- # We use `--features "full,test-util"` instead of `--all-features` since
558- # `--all-features` includes `io_uring`, which is not available on all targets.
559- cargo nextest run -p tokio --features full,test-util --target ${{ matrix.target }}
560- cargo test --doc -p tokio --features full,test-util --target ${{ matrix.target }}
555+ # We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since
556+ # `--all-features` includes `io_uring` and `taskdump`,
557+ # which is not available on all targets.
558+ cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
559+ cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
561560 env :
562561 RUST_TEST_THREADS : 1
563- RUSTFLAGS : --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests ${{ matrix.rustflags }}
562+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests
563+ RUSTDOCFLAGS : --cfg tokio_unstable -Dwarnings
564564
565565 cross-test-without-parking_lot :
566566 needs : basics
@@ -570,14 +570,14 @@ jobs:
570570 include :
571571 - target : i686-unknown-linux-gnu
572572 os : ubuntu-latest
573- rustflags : --cfg tokio_taskdump
573+ extra_features : " taskdump "
574574 - target : armv5te-unknown-linux-gnueabi
575575 os : ubuntu-latest
576576 - target : armv7-unknown-linux-gnueabihf
577577 os : ubuntu-24.04-arm
578578 - target : aarch64-unknown-linux-gnu
579579 os : ubuntu-24.04-arm
580- rustflags : --cfg tokio_taskdump
580+ extra_features : " io-uring,taskdump "
581581 - target : aarch64-pc-windows-msvc
582582 os : windows-11-arm
583583 steps :
@@ -606,13 +606,15 @@ jobs:
606606 - name : Tests run with all features (without parking_lot)
607607 run : |
608608 set -euxo pipefail
609- # We use `--features "full,test-util"` instead of `--all-features` since
610- # `--all-features` includes `io_uring`, which is not available on all targets.
611- cargo nextest run -p tokio --features full,test-util --target ${{ matrix.target }}
612- cargo test --doc -p tokio --features full,test-util --target ${{ matrix.target }}
609+ # We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since
610+ # `--all-features` includes `io_uring` and `taskdump`,
611+ # which is not available on all targets.
612+ cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
613+ cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
613614 env :
614615 RUST_TEST_THREADS : 1
615616 RUSTFLAGS : --cfg tokio_unstable -Dwarnings --cfg tokio_no_parking_lot --cfg tokio_no_tuning_tests ${{ matrix.rustflags }}
617+ RUSTDOCFLAGS : --cfg tokio_unstable -Dwarnings
616618
617619 # See https://github.com/tokio-rs/tokio/issues/5187
618620 no-atomic-u64-test :
@@ -640,13 +642,11 @@ jobs:
640642 - uses : Swatinem/rust-cache@v2
641643 - name : test tokio --all-features
642644 run : |
643- # We use `--features "full,test-util"` instead of `--all-features` since
644- # `--all-features` includes `io_uring`, which is not available on all targets.
645- cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util
646- cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util
645+ cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump
646+ cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump
647647 env :
648648 RUST_TEST_THREADS : 1
649- RUSTFLAGS : --cfg tokio_unstable --cfg tokio_taskdump - Dwarnings --cfg tokio_no_tuning_tests
649+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests
650650
651651 no-atomic-u64-check :
652652 name : Check tokio --feature-powerset --depth 2 on i686-unknown-linux-gnu without AtomicU64
@@ -672,18 +672,24 @@ jobs:
672672 # We use `--skip io-uring` since io-uring crate doesn't provide a binding for the i686 target.
673673 run : cargo hack check -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --feature-powerset --skip io-uring --depth 2 --keep-going
674674 env :
675- RUSTFLAGS : --cfg tokio_unstable --cfg tokio_taskdump - Dwarnings
675+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings
676676
677677 features :
678- name : features ${{ matrix.name }}
678+ name : features exclude ${{ matrix.name }}
679679 needs : basics
680680 runs-on : ubuntu-latest
681681 strategy :
682682 matrix :
683683 include :
684- - { name: "", rustflags: "", exclude_features: "io-uring" }
685- - { name: "--unstable", rustflags: "--cfg tokio_unstable -Dwarnings", exclude_features: "" }
686- - { name: "--unstable --taskdump", rustflags: "--cfg tokio_unstable -Dwarnings --cfg tokio_taskdump", exclude_features: "" }
684+ - name : " "
685+ rustflags : " "
686+ exclude_features : " io-uring,taskdump"
687+ - name : " --unstable"
688+ rustflags : " --cfg tokio_unstable -Dwarnings"
689+ exclude_features : " io-uring,taskdump"
690+ - name : " --unstable io-uring,taskdump"
691+ rustflags : " --cfg tokio_unstable -Dwarnings"
692+ exclude_features : " "
687693 steps :
688694 - uses : actions/checkout@v5
689695 - name : Install Rust ${{ env.rust_nightly }}
@@ -749,7 +755,7 @@ jobs:
749755 cargo hack check -p tokio-macros -p tokio-stream -p tokio-util -p tokio-test --all-features --ignore-private
750756 - name : " check --all-features --unstable -Z minimal-versions"
751757 env :
752- RUSTFLAGS : --cfg tokio_unstable --cfg tokio_taskdump - Dwarnings
758+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings
753759 run : |
754760 # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
755761 # from determining minimal versions based on dev-dependencies.
@@ -795,7 +801,7 @@ jobs:
795801 - name : " clippy --all --all-features --unstable"
796802 run : cargo clippy --all --tests --no-deps --all-features
797803 env :
798- RUSTFLAGS : --cfg tokio_unstable --cfg tokio_taskdump - Dwarnings
804+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings
799805
800806 docs :
801807 name : docs
@@ -804,9 +810,9 @@ jobs:
804810 matrix :
805811 run :
806812 - os : windows-latest
813+ extra_features : " tracing"
807814 - os : ubuntu-latest
808- RUSTFLAGS : --cfg tokio_taskdump
809- RUSTDOCFLAGS : --cfg tokio_taskdump
815+ extra_features : " tracing,io-uring,taskdump"
810816
811817 steps :
812818 - uses : actions/checkout@v5
@@ -816,11 +822,10 @@ jobs:
816822 toolchain : ${{ env.rust_nightly }}
817823 - uses : Swatinem/rust-cache@v2
818824 - name : " doc --lib --all-features"
819- run : |
820- cargo doc --lib --no-deps --all-features --document-private-items
825+ run : cargo doc --lib --no-deps --document-private-items --features $TOKIO_STABLE_FEATURES,${{ matrix.run.extra_features }}
821826 env :
822- RUSTFLAGS : --cfg docsrs --cfg tokio_unstable ${{ matrix.run.RUSTFLAGS }}
823- RUSTDOCFLAGS : --cfg docsrs --cfg tokio_unstable -Dwarnings ${{ matrix.run.RUSTDOCFLAGS }}
827+ RUSTFLAGS : --cfg docsrs --cfg tokio_unstable
828+ RUSTDOCFLAGS : --cfg docsrs --cfg tokio_unstable -Dwarnings
824829
825830 loom-compile :
826831 name : build loom tests
@@ -1083,26 +1088,31 @@ jobs:
10831088 runs-on : ${{ matrix.os }}
10841089 strategy :
10851090 matrix :
1086- os :
1087- - windows-latest
1088- - ubuntu-latest
1089- rust :
1090- # `check-external-types` requires a specific Rust nightly version. See
1091- # the README for details: https://github.com/awslabs/cargo-check-external-types
1092- - nightly-2024-06-30
1091+ include :
1092+ - os : windows-latest
1093+ # Windows neither supports io-uring nor taskdump.
1094+ extra_features : " tracing "
1095+ - os : ubuntu-latest
1096+ # includes all unstable features.
1097+ extra_features : " tracing,io-uring,taskdump "
10931098 steps :
10941099 - uses : actions/checkout@v5
10951100 - name : Install Rust ${{ matrix.rust }}
10961101 uses : dtolnay/rust-toolchain@stable
10971102 with :
1098- toolchain : ${{ matrix.rust }}
1103+ # `check-external-types` requires a specific Rust nightly version. See
1104+ # the README for details: https://github.com/awslabs/cargo-check-external-types
1105+ toolchain : nightly-2025-08-06
10991106 - uses : Swatinem/rust-cache@v2
11001107 - name : Install cargo-check-external-types
11011108 uses : taiki-e/cache-cargo-install-action@v1
11021109 with :
1103- tool : cargo-check-external-types@0.1.13
1110+ tool : cargo-check-external-types@0.3.0
11041111 - name : check-external-types
1105- run : cargo check-external-types --features $TOKIO_STABLE_FEATURES
1112+ env :
1113+ RUSTFLAGS : --cfg tokio_unstable -Dwarnings
1114+ RUSTDOCFLAGS : --cfg tokio_unstable
1115+ run : cargo check-external-types --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }}
11061116 working-directory : tokio
11071117
11081118 check-fuzzing :
0 commit comments