diff --git a/actix-connect/Cargo.toml b/actix-connect/Cargo.toml index 37b93c65..a93722b1 100644 --- a/actix-connect/Cargo.toml +++ b/actix-connect/Cargo.toml @@ -40,7 +40,7 @@ derive_more = "0.99.2" either = "1.5.3" futures-util = { version = "0.3.4", default-features = false } # FIXME: Use release version -http = { git = "https://github.com/paolobarbolini/http.git", branch = "bytes06", optional = true } +http = { git = "https://github.com/fakeshadow/http.git", optional = true } log = "0.4" # FIXME: Use release version trust-dns-proto = { git = "https://github.com/bluejekyll/trust-dns", branch = "main", default-features = false, features = ["tokio-runtime"] } diff --git a/actix-rt/tests/integration_tests.rs b/actix-rt/tests/integration_tests.rs index c1d2b910..5471f800 100644 --- a/actix-rt/tests/integration_tests.rs +++ b/actix-rt/tests/integration_tests.rs @@ -112,3 +112,29 @@ fn join_current_arbiter() { "local_join should await only for the already spawned futures" ); } + +#[test] +fn non_static_block_on() { + let string = String::from("test_str"); + let str = string.as_str(); + + let sys = actix_rt::System::new("borrow some"); + + sys.block_on(async { + actix_rt::time::sleep(Duration::from_millis(1)).await; + assert_eq!("test_str", str); + }); + + let rt = actix_rt::Runtime::new().unwrap(); + + rt.block_on(async { + actix_rt::time::sleep(Duration::from_millis(1)).await; + assert_eq!("test_str", str); + }); + + actix_rt::System::run(|| { + assert_eq!("test_str", str); + actix_rt::System::current().stop(); + }) + .unwrap(); +} diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index b0462b13..6a0d7da9 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -58,7 +58,7 @@ impl Signals { ), } } - + actix_rt::spawn(Signals { srv, streams }); } } diff --git a/actix-service/src/pipeline.rs b/actix-service/src/pipeline.rs index 75cd6af9..3951809d 100644 --- a/actix-service/src/pipeline.rs +++ b/actix-service/src/pipeline.rs @@ -183,17 +183,14 @@ impl PipelineFactory { factory: F, ) -> PipelineFactory< impl ServiceFactory< - Request = T::Request, - Response = U::Response, - Error = T::Error, - Config = T::Config, - InitError = T::InitError, - Service = impl Service< - Request = T::Request, - Response = U::Response, - Error = T::Error, - > + Clone, - > + Clone, + Request = T::Request, + Response = U::Response, + Error = T::Error, + Config = T::Config, + InitError = T::InitError, + Service = impl Service + + Clone, + > + Clone, > where Self: Sized, @@ -221,13 +218,13 @@ impl PipelineFactory { f: F, ) -> PipelineFactory< impl ServiceFactory< - Request = T::Request, - Response = Res, - Error = Err, - Config = T::Config, - InitError = T::InitError, - Service = impl Service + Clone, - > + Clone, + Request = T::Request, + Response = Res, + Error = Err, + Config = T::Config, + InitError = T::InitError, + Service = impl Service + Clone, + > + Clone, > where Self: Sized, @@ -254,17 +251,14 @@ impl PipelineFactory { factory: F, ) -> PipelineFactory< impl ServiceFactory< - Request = T::Request, - Response = U::Response, - Error = T::Error, - Config = T::Config, - InitError = T::InitError, - Service = impl Service< - Request = T::Request, - Response = U::Response, - Error = T::Error, - > + Clone, - > + Clone, + Request = T::Request, + Response = U::Response, + Error = T::Error, + Config = T::Config, + InitError = T::InitError, + Service = impl Service + + Clone, + > + Clone, > where Self: Sized,