executor: move current-thread into crate (#1447)

The `CurrentThread` executor is exposed using a feature flag.

Refs: #1264
This commit is contained in:
Carl Lerche
2019-08-15 09:52:25 -07:00
committed by GitHub
parent 8d55f98f6f
commit 9de7083be8
25 changed files with 110 additions and 174 deletions
+17
View File
@@ -0,0 +1,17 @@
[package]
name = "ui-tests"
version = "0.1.0"
authors = ["Carl Lerche <[email protected]>"]
edition = "2018"
publish = false
[features]
executor-without-current-thread = ["tokio-executor"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio-executor = { path = "../tokio-executor", optional = true }
[dev-dependencies]
trybuild = "1.0"
+2
View File
@@ -0,0 +1,2 @@
Tests the various combination of feature flags. This is broken out to a separate
crate to work around limitations with cargo features.
+2
View File
@@ -0,0 +1,2 @@
#[cfg(feature = "tokio-executor")]
pub use tokio_executor;
+9
View File
@@ -0,0 +1,9 @@
#[test]
fn features() {
let t = trybuild::TestCases::new();
#[cfg(feature = "executor-without-current-thread")]
t.compile_fail("tests/ui/executor_without_current_thread.rs");
drop(t);
}
@@ -0,0 +1,3 @@
use ui_tests::tokio_executor::current_thread;
fn main() {}
@@ -0,0 +1,7 @@
error[E0432]: unresolved import `ui_tests::tokio_executor::current_thread`
--> $DIR/executor_without_current_thread.rs:1:5
|
1 | use ui_tests::tokio_executor::current_thread;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `current_thread` in `tokio_executor`
For more information about this error, try `rustc --explain E0432`.