mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-06 00:00:10 +02:00
reactor: rename tokio-reactor -> tokio-net (#1450)
* reactor: rename tokio-reactor -> tokio-net This is in preparation for #1264
This commit is contained in:
@@ -7,11 +7,14 @@ publish = false
|
||||
|
||||
[features]
|
||||
executor-without-current-thread = ["tokio-executor"]
|
||||
tokio-no-features = ["tokio"]
|
||||
tokio-with-net = ["tokio/net"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tokio-executor = { path = "../tokio-executor", optional = true }
|
||||
tokio = { path = "../tokio", optional = true, default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
trybuild = "1.0"
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
#[cfg(feature = "tokio-executor")]
|
||||
pub use tokio_executor;
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub use tokio;
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
#[test]
|
||||
fn features() {
|
||||
#[cfg(feature = "tokio-with-net")]
|
||||
#[allow(unused_imports)]
|
||||
fn tokio_with_net() {
|
||||
// Reactor is present
|
||||
use ui_tests::tokio::reactor;
|
||||
|
||||
// net is present
|
||||
use ui_tests::tokio::net;
|
||||
}
|
||||
#[test]
|
||||
fn compile_fail() {
|
||||
let t = trybuild::TestCases::new();
|
||||
|
||||
#[cfg(feature = "executor-without-current-thread")]
|
||||
t.compile_fail("tests/ui/executor_without_current_thread.rs");
|
||||
|
||||
#[cfg(feature = "tokio-no-features")]
|
||||
t.compile_fail("tests/ui/tokio_without_net_missing_reactor.rs");
|
||||
|
||||
drop(t);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
use ui_tests::tokio::reactor;
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,7 @@
|
||||
error[E0432]: unresolved import `ui_tests::tokio::reactor`
|
||||
--> $DIR/tokio_without_net_missing_reactor.rs:1:5
|
||||
|
|
||||
1 | use ui_tests::tokio::reactor;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ no `reactor` in `tokio`
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
Reference in New Issue
Block a user