Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove internal io-readiness cargo feature #2878

Merged
merged 1 commit into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ jobs:
run: cargo install cargo-hack

- name: check --each-feature
run: cargo hack check --all --each-feature --skip io-driver,io-readiness -Z avoid-dev-deps
run: cargo hack check --all --each-feature --skip io-driver -Z avoid-dev-deps

# Try with unstable feature flags
- name: check --each-feature --unstable
run: cargo hack check --all --each-feature --skip io-driver,io-readiness -Z avoid-dev-deps
run: cargo hack check --all --each-feature --skip io-driver -Z avoid-dev-deps
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings

Expand Down
5 changes: 2 additions & 3 deletions tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ blocking = ["rt-core"]
dns = ["rt-core"]
fs = ["rt-core", "io-util"]
io-driver = ["mio", "lazy_static"] # internal only
io-readiness = [] # internal only
io-util = ["memchr"]
# stdin, stdout, stderr
io-std = ["rt-core"]
Expand Down Expand Up @@ -86,8 +85,8 @@ sync = ["fnv"]
test-util = []
tcp = ["io-driver", "iovec"]
time = ["slab"]
udp = ["io-driver", "io-readiness"]
uds = ["io-driver", "io-readiness", "mio-uds", "libc"]
udp = ["io-driver"]
uds = ["io-driver", "mio-uds", "libc"]

[dependencies]
tokio-macros = { version = "0.3.0", path = "../tokio-macros", optional = true }
Expand Down
9 changes: 5 additions & 4 deletions tokio/src/io/driver/scheduled_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ pub(crate) struct ScheduledIo {
waiters: Mutex<Waiters>,
}

#[cfg(feature = "io-readiness")]
type WaitList = LinkedList<Waiter, <Waiter as linked_list::Link>::Target>;
cfg_io_readiness! {
type WaitList = LinkedList<Waiter, <Waiter as linked_list::Link>::Target>;
}

#[derive(Debug, Default)]
struct Waiters {
#[cfg(feature = "io-readiness")]
#[cfg(any(feature = "udp", feature = "uds"))]
/// List of all current waiters
list: WaitList,

Expand Down Expand Up @@ -208,7 +209,7 @@ impl ScheduledIo {
}
}

#[cfg(feature = "io-readiness")]
#[cfg(any(feature = "udp", feature = "uds"))]
{
// check list of waiters
for waiter in waiters
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/macros/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ macro_rules! cfg_not_io_driver {
macro_rules! cfg_io_readiness {
($($item:item)*) => {
$(
#[cfg(feature = "io-readiness")]
#[cfg(any(feature = "udp", feature = "uds"))]
$item
)*
}
Expand Down