mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
executor: move current-thread into crate (#1447)
The `CurrentThread` executor is exposed using a feature flag. Refs: #1264
This commit is contained in:
@@ -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"
|
||||
@@ -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.
|
||||
@@ -0,0 +1,2 @@
|
||||
#[cfg(feature = "tokio-executor")]
|
||||
pub use tokio_executor;
|
||||
@@ -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`.
|
||||
Reference in New Issue
Block a user