From 0d38936b35779b604770120da2e98560bbb6241f Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Mon, 18 Nov 2019 07:00:55 -0800 Subject: chore: refine feature flags (#1785) Removes dependencies between Tokio feature flags. For example, `process` should not depend on `sync` simply because it uses the `mpsc` channel. Instead, feature flags represent **public** APIs that become available with the feature enabled. When the feature is not enabled, the functionality is removed. If another Tokio component requires the functionality, it is stays as `pub(crate)`. The threaded scheduler is now exposed under `rt-threaded`. This feature flag only enables the threaded scheduler and does not include I/O, networking, or time. Those features must be explictly enabled. A `full` feature flag is added that enables all features. `stdin`, `stdout`, `stderr` are exposed under `io-std`. Macros are used to scope code by feature flag. --- tokio/src/sync/oneshot.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tokio/src/sync/oneshot.rs') diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs index 7b84f319..ed3801c8 100644 --- a/tokio/src/sync/oneshot.rs +++ b/tokio/src/sync/oneshot.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(feature = "sync"), allow(dead_code, unreachable_pub))] + //! A channel for sending a single message between asynchronous tasks. use crate::loom::cell::CausalCell; -- cgit v1.2.3