diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index a7e0a0309..77918341a 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -1,6 +1,13 @@ # Changes ## Unreleased - 2021-xx-xx +### Added +- On-by-default `macros` feature flag to enable routing and runtime macros. [#2619] + +### Removed +- `rt::{Arbiter, ArbiterHandle}` re-exports. [#2619] + +[#2601]: https://github.com/actix/actix-web/pull/2601 ## 4.0.0-rc.1 - 2022-01-31 diff --git a/actix-web/Cargo.toml b/actix-web/Cargo.toml index f5c2cb65b..92c303b5c 100644 --- a/actix-web/Cargo.toml +++ b/actix-web/Cargo.toml @@ -39,6 +39,7 @@ compress-zstd = ["actix-http/compress-zstd", "__compress"] # Routing and runtime proc macros macros = [ + "actix-rt/macros", "actix-macros", "actix-web-codegen", ] @@ -67,9 +68,9 @@ actix-codec = "0.4.1" actix-macros = { version = "0.2.3", optional = true } actix-rt = { version = "2.6", default-features = false } actix-server = "2" -actix-service = "2.0.0" -actix-utils = "3.0.0" -actix-tls = { version = "3.0.0", default-features = false, optional = true } +actix-service = "2" +actix-utils = "3" +actix-tls = { version = "3", default-features = false, optional = true } actix-http = { version = "3.0.0-rc.1", features = ["http2", "ws"] } actix-router = "0.5.0-rc.3" diff --git a/actix-web/src/rt.rs b/actix-web/src/rt.rs index c7e582957..87d76048f 100644 --- a/actix-web/src/rt.rs +++ b/actix-web/src/rt.rs @@ -26,7 +26,13 @@ //! # } //! ``` -// In particular, omit the runtime macros because they won't work and are re-exported directly -// at the top-level anyway. Also omit the `Arbiter` types because they have limited value here. +// In particular: +// - Omit the `Arbiter` types because they have limited value here. +// - Re-export but hide the runtime macros because they won't work directly but are required for +// `#[actix_web::main]` and `#[actix_web::test]` to work. pub use actix_rt::{net, pin, signal, spawn, task, time, Runtime, System, SystemRunner}; + +#[cfg(feature = "macros")] +#[doc(hidden)] +pub use actix_rt::{main, test};