Skip to content

Commit c30a0e9

Browse files
committed
apply review: rename cfg
1 parent 14443af commit c30a0e9

File tree

7 files changed

+27
-48
lines changed

7 files changed

+27
-48
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ jobs:
350350
# the unstable cfg to RustDoc
351351
RUSTDOCFLAGS: --cfg tokio_unstable --cfg tokio_taskdump
352352

353-
test-unstable-uring:
354-
name: test tokio full --cfg tokio_unstable_uring
353+
test-uring:
354+
name: test tokio full --cfg tokio_uring
355355
needs: basics
356356
runs-on: ${{ matrix.os }}
357357
strategy:
@@ -371,18 +371,17 @@ jobs:
371371
tool: cargo-nextest
372372

373373
- uses: Swatinem/rust-cache@v2
374-
# Run `tokio` with "unstable" and "taskdump" cfg flags.
375-
- name: test tokio full --cfg tokio_unstable_uring
374+
- name: test tokio full --cfg tokio_uring
376375
run: |
377376
set -euxo pipefail
378377
cargo nextest run --all-features
379378
cargo test --doc --all-features
380379
working-directory: tokio
381380
env:
382-
RUSTFLAGS: --cfg tokio_unstable_uring -Dwarnings
381+
RUSTFLAGS: --cfg tokio_uring -Dwarnings
383382
# in order to run doctests for unstable features, we must also pass
384383
# the unstable cfg to RustDoc
385-
RUSTDOCFLAGS: --cfg tokio_unstable_uring
384+
RUSTDOCFLAGS: --cfg tokio_uring
386385

387386
check-unstable-mt-counters:
388387
name: check tokio full --internal-mt-counters
@@ -737,8 +736,8 @@ jobs:
737736
- { name: "--unstable", rustflags: "--cfg tokio_unstable -Dwarnings" }
738737
# Try with unstable and taskdump feature flags
739738
- { name: "--unstable --taskdump", rustflags: "--cfg tokio_unstable -Dwarnings --cfg tokio_taskdump" }
740-
- { name: "--tokio_unstable_uring", rustflags: "-Dwarnings --cfg tokio_unstable_uring" }
741-
- { name: "--unstable --taskdump --tokio_unstable_uring", rustflags: "--cfg tokio_unstable -Dwarnings --cfg tokio_taskdump --cfg tokio_unstable_uring" }
739+
- { name: "--tokio_uring", rustflags: "-Dwarnings --cfg tokio_uring" }
740+
- { name: "--unstable --taskdump --tokio_uring", rustflags: "--cfg tokio_unstable -Dwarnings --cfg tokio_taskdump --cfg tokio_uring" }
742741
steps:
743742
- uses: actions/checkout@v4
744743
- name: Install Rust ${{ env.rust_nightly }}
@@ -801,7 +800,7 @@ jobs:
801800
cargo hack check --all-features --ignore-private
802801
- name: "check --all-features --unstable -Z minimal-versions"
803802
env:
804-
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump --cfg tokio_unstable_uring -Dwarnings
803+
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump --cfg tokio_uring -Dwarnings
805804
run: |
806805
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
807806
# from determining minimal versions based on dev-dependencies.
@@ -853,8 +852,8 @@ jobs:
853852
run:
854853
- os: windows-latest
855854
- os: ubuntu-latest
856-
RUSTFLAGS: --cfg tokio_taskdump --cfg tokio_unstable_uring
857-
RUSTDOCFLAGS: --cfg tokio_taskdump --cfg tokio_unstable_uring
855+
RUSTFLAGS: --cfg tokio_taskdump --cfg tokio_uring
856+
RUSTDOCFLAGS: --cfg tokio_taskdump --cfg tokio_uring
858857

859858
steps:
860859
- uses: actions/checkout@v4

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ unexpected_cfgs = { level = "warn", check-cfg = [
2929
'cfg(tokio_no_tuning_tests)',
3030
'cfg(tokio_taskdump)',
3131
'cfg(tokio_unstable)',
32-
'cfg(tokio_unstable_uring)',
32+
'cfg(tokio_uring)',
3333
] }

tokio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ socket2 = { version = "0.5.5", optional = true, features = ["all"] }
103103
[target.'cfg(tokio_unstable)'.dependencies]
104104
tracing = { version = "0.1.29", default-features = false, features = ["std"], optional = true } # Not in full
105105

106-
[target.'cfg(all(tokio_unstable_uring, target_os = "linux"))'.dependencies]
106+
[target.'cfg(all(tokio_uring, target_os = "linux"))'.dependencies]
107107
io-uring = { version = "0.7.6", default-features = false }
108108
libc = { version = "0.2.168" }
109109
mio = { version = "1.0.1", default-features = false, features = ["os-poll", "os-ext"] }

tokio/src/macros/cfg.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ macro_rules! cfg_io_driver {
121121
all(unix, feature = "process"),
122122
all(unix, feature = "signal"),
123123
all(
124-
tokio_unstable_uring,
124+
tokio_uring,
125125
feature = "rt",
126126
feature = "fs",
127127
target_os = "linux"
@@ -132,7 +132,7 @@ macro_rules! cfg_io_driver {
132132
all(unix, feature = "process"),
133133
all(unix, feature = "signal"),
134134
all(
135-
tokio_unstable_uring,
135+
tokio_uring,
136136
feature = "rt",
137137
feature = "fs",
138138
target_os = "linux"
@@ -151,7 +151,7 @@ macro_rules! cfg_io_driver_impl {
151151
all(unix, feature = "process"),
152152
all(unix, feature = "signal"),
153153
all(
154-
tokio_unstable_uring,
154+
tokio_uring,
155155
feature = "rt",
156156
feature = "fs",
157157
target_os = "linux"
@@ -170,7 +170,7 @@ macro_rules! cfg_not_io_driver {
170170
all(unix, feature = "process"),
171171
all(unix, feature = "signal"),
172172
all(
173-
tokio_unstable_uring,
173+
tokio_uring,
174174
feature = "rt",
175175
feature = "fs",
176176
target_os = "linux"
@@ -309,7 +309,7 @@ macro_rules! cfg_net_or_uring {
309309
#[cfg(any(
310310
feature = "net",
311311
all(
312-
tokio_unstable_uring,
312+
tokio_uring,
313313
feature = "rt",
314314
feature = "fs",
315315
target_os = "linux",
@@ -320,7 +320,7 @@ macro_rules! cfg_net_or_uring {
320320
doc(cfg(any(
321321
feature = "net",
322322
all(
323-
tokio_unstable_uring,
323+
tokio_uring,
324324
feature = "rt",
325325
feature = "fs",
326326
target_os = "linux",
@@ -670,11 +670,11 @@ macro_rules! cfg_metrics_variant {
670670
}
671671
}
672672

673-
macro_rules! cfg_tokio_unstable_uring {
673+
macro_rules! cfg_tokio_uring {
674674
($($item:item)*) => {
675675
$(
676676
#[cfg(all(
677-
tokio_unstable_uring,
677+
tokio_uring,
678678
feature = "rt",
679679
feature = "fs",
680680
target_os = "linux",

tokio/src/runtime/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,6 @@ cfg_not_time! {
348348
}
349349
}
350350

351-
cfg_tokio_unstable_uring! {
351+
cfg_tokio_uring! {
352352
pub(crate) mod op;
353353
}

tokio/src/runtime/io/driver.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cfg_signal_internal_and_unix! {
33
mod signal;
44
}
5-
cfg_tokio_unstable_uring! {
5+
cfg_tokio_uring! {
66
mod uring;
77
use uring::UringContext;
88
}
@@ -50,12 +50,7 @@ pub(crate) struct Handle {
5050

5151
pub(crate) metrics: IoDriverMetrics,
5252

53-
#[cfg(all(
54-
tokio_unstable_uring,
55-
feature = "rt",
56-
feature = "fs",
57-
target_os = "linux",
58-
))]
53+
#[cfg(all(tokio_uring, feature = "rt", feature = "fs", target_os = "linux",))]
5954
pub(crate) uring_context: Mutex<UringContext>,
6055
}
6156

@@ -124,21 +119,11 @@ impl Driver {
124119
#[cfg(not(target_os = "wasi"))]
125120
waker,
126121
metrics: IoDriverMetrics::default(),
127-
#[cfg(all(
128-
tokio_unstable_uring,
129-
feature = "rt",
130-
feature = "fs",
131-
target_os = "linux",
132-
))]
122+
#[cfg(all(tokio_uring, feature = "rt", feature = "fs", target_os = "linux",))]
133123
uring_context: Mutex::new(UringContext::new()),
134124
};
135125

136-
#[cfg(all(
137-
tokio_unstable_uring,
138-
feature = "rt",
139-
feature = "fs",
140-
target_os = "linux",
141-
))]
126+
#[cfg(all(tokio_uring, feature = "rt", feature = "fs", target_os = "linux",))]
142127
{
143128
handle.add_uring_source(Interest::READABLE)?;
144129
}
@@ -216,12 +201,7 @@ impl Driver {
216201
};
217202
}
218203

219-
#[cfg(all(
220-
tokio_unstable_uring,
221-
feature = "rt",
222-
feature = "fs",
223-
target_os = "linux",
224-
))]
204+
#[cfg(all(tokio_uring, feature = "rt", feature = "fs", target_os = "linux",))]
225205
{
226206
let mut guard = handle.get_uring().lock();
227207
let ctx = &mut *guard;

tokio/src/runtime/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![cfg_attr(
2-
not(all(feature = "rt", feature = "net", tokio_unstable_uring)),
2+
not(all(feature = "rt", feature = "net", tokio_uring)),
33
allow(dead_code)
44
)]
55
mod driver;

0 commit comments

Comments
 (0)