diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 6b15c6ed..efdd58a5 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -1,10 +1,14 @@ # Changes ## Unreleased - 2021-xx-xx + + +## 2.0.0-beta.2 - 2021-01-09 * Add `task` mod with re-export of `tokio::task::{spawn_blocking, yield_now, JoinHandle}` [#245] [#245]: https://github.com/actix/actix-net/pull/245 + ## 2.0.0-beta.1 - 2020-12-28 ### Added * Add `System::attach_to_tokio` method. [#173] diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 1386e121..f2fe8435 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-rt" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" authors = ["Nikolay Kim "] description = "Tokio-based single-thread async runtime for the Actix ecosystem" keywords = ["network", "framework", "async", "futures"] @@ -15,7 +15,11 @@ edition = "2018" name = "actix_rt" path = "src/lib.rs" +[features] +default = ["macros"] +macros = ["actix-macros"] + [dependencies] -actix-macros = "0.2.0-beta.1" +actix-macros = { version = "0.2.0-beta.1", optional = true } tokio = { version = "1", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] } diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index 6ccd588f..30fa2d78 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -7,7 +7,9 @@ use std::future::Future; -#[cfg(not(test))] // Work around for rust-lang/rust#62127 +// Cannot define a main macro when compiled into test harness. +// Workaround for https://github.com/rust-lang/rust/issues/62127. +#[cfg(all(feature = "macros", not(test)))] pub use actix_macros::{main, test}; mod arbiter; @@ -64,7 +66,7 @@ pub mod time { pub use tokio::time::{timeout, Timeout}; } -/// task management. +/// Blocking task management. pub mod task { pub use tokio::task::{spawn_blocking, yield_now, JoinHandle}; }