From 7f59a6ea859141e9da76dfd77605256a6224ff2c Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sun, 5 May 2024 17:18:37 +0200 Subject: [PATCH 1/2] tests: remove tests module from integration tests (#6540) --- tokio/tests/task_builder.rs | 135 ++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 68 deletions(-) diff --git a/tokio/tests/task_builder.rs b/tokio/tests/task_builder.rs index 78329ff26a4..c700f229f9f 100644 --- a/tokio/tests/task_builder.rs +++ b/tokio/tests/task_builder.rs @@ -1,81 +1,80 @@ -#[cfg(all(tokio_unstable, feature = "tracing"))] -mod tests { - use std::rc::Rc; - use tokio::{ - task::{Builder, LocalSet}, - test, - }; +#![cfg(all(tokio_unstable, feature = "tracing"))] - #[test] - async fn spawn_with_name() { - let result = Builder::new() - .name("name") - .spawn(async { "task executed" }) - .unwrap() - .await; +use std::rc::Rc; +use tokio::{ + task::{Builder, LocalSet}, + test, +}; - assert_eq!(result.unwrap(), "task executed"); - } +#[test] +async fn spawn_with_name() { + let result = Builder::new() + .name("name") + .spawn(async { "task executed" }) + .unwrap() + .await; - #[test] - async fn spawn_blocking_with_name() { - let result = Builder::new() - .name("name") - .spawn_blocking(|| "task executed") - .unwrap() - .await; + assert_eq!(result.unwrap(), "task executed"); +} + +#[test] +async fn spawn_blocking_with_name() { + let result = Builder::new() + .name("name") + .spawn_blocking(|| "task executed") + .unwrap() + .await; - assert_eq!(result.unwrap(), "task executed"); - } + assert_eq!(result.unwrap(), "task executed"); +} - #[test] - async fn spawn_local_with_name() { - let unsend_data = Rc::new("task executed"); - let result = LocalSet::new() - .run_until(async move { - Builder::new() - .name("name") - .spawn_local(async move { unsend_data }) - .unwrap() - .await - }) - .await; +#[test] +async fn spawn_local_with_name() { + let unsend_data = Rc::new("task executed"); + let result = LocalSet::new() + .run_until(async move { + Builder::new() + .name("name") + .spawn_local(async move { unsend_data }) + .unwrap() + .await + }) + .await; - assert_eq!(*result.unwrap(), "task executed"); - } + assert_eq!(*result.unwrap(), "task executed"); +} - #[test] - async fn spawn_without_name() { - let result = Builder::new() - .spawn(async { "task executed" }) - .unwrap() - .await; +#[test] +async fn spawn_without_name() { + let result = Builder::new() + .spawn(async { "task executed" }) + .unwrap() + .await; - assert_eq!(result.unwrap(), "task executed"); - } + assert_eq!(result.unwrap(), "task executed"); +} - #[test] - async fn spawn_blocking_without_name() { - let result = Builder::new() - .spawn_blocking(|| "task executed") - .unwrap() - .await; +#[test] +async fn spawn_blocking_without_name() { + let result = Builder::new() + .spawn_blocking(|| "task executed") + .unwrap() + .await; - assert_eq!(result.unwrap(), "task executed"); - } + assert_eq!(result.unwrap(), "task executed"); +} - #[test] - async fn spawn_local_without_name() { - let unsend_data = Rc::new("task executed"); - let result = LocalSet::new() - .run_until(async move { - Builder::new() - .spawn_local(async move { unsend_data }) - .unwrap() - .await - }) - .await; +#[test] +async fn spawn_local_without_name() { + let unsend_data = Rc::new("task executed"); + let result = LocalSet::new() + .run_until(async move { + Builder::new() + .spawn_local(async move { unsend_data }) + .unwrap() + .await + }) + .await; - assert_eq!(*result.unwrap(), "task executed"); - } + assert_eq!(*result.unwrap(), "task executed"); } From b652a4e64c3547af62c91f55d8fcbc3be0333d6e Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sun, 5 May 2024 17:18:49 +0200 Subject: [PATCH 2/2] util: no default features for hashbrown (#6541) --- tokio-util/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-util/Cargo.toml b/tokio-util/Cargo.toml index 13e56dd8511..a33e9c9cff7 100644 --- a/tokio-util/Cargo.toml +++ b/tokio-util/Cargo.toml @@ -45,7 +45,7 @@ slab = { version = "0.4.4", optional = true } # Backs `DelayQueue` tracing = { version = "0.1.25", default-features = false, features = ["std"], optional = true } [target.'cfg(tokio_unstable)'.dependencies] -hashbrown = { version = "0.14.0", optional = true } +hashbrown = { version = "0.14.0", default-features = false, optional = true } [dev-dependencies] tokio = { version = "1.0.0", path = "../tokio", features = ["full"] }