From 5e15c4f03f39f34abc3066e07a1df2216c9c1dc3 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 20 Feb 2024 13:48:44 +0100 Subject: [PATCH] Revert to using wrong case for static variable name. --- src/pool/arc.rs | 7 +++++-- src/pool/boxed.rs | 7 +++++-- src/pool/object.rs | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/pool/arc.rs b/src/pool/arc.rs index 71637759de..7dd38a797c 100644 --- a/src/pool/arc.rs +++ b/src/pool/arc.rs @@ -89,10 +89,13 @@ macro_rules! arc_pool { type Data = $data_type; fn singleton() -> &'static $crate::pool::arc::ArcPoolImpl<$data_type> { - static POOL: $crate::pool::arc::ArcPoolImpl<$data_type> = + // Even though the static variable is not exposed to user code, it is + // still useful to have a descriptive symbol name for debugging. + #[allow(non_upper_case_globals)] + static $name: $crate::pool::arc::ArcPoolImpl<$data_type> = $crate::pool::arc::ArcPoolImpl::new(); - &POOL + &$name } } diff --git a/src/pool/boxed.rs b/src/pool/boxed.rs index 8f4439f004..bf880e92f4 100644 --- a/src/pool/boxed.rs +++ b/src/pool/boxed.rs @@ -101,10 +101,13 @@ macro_rules! box_pool { type Data = $data_type; fn singleton() -> &'static $crate::pool::boxed::BoxPoolImpl<$data_type> { - static POOL: $crate::pool::boxed::BoxPoolImpl<$data_type> = + // Even though the static variable is not exposed to user code, it is + // still useful to have a descriptive symbol name for debugging. + #[allow(non_upper_case_globals)] + static $name: $crate::pool::boxed::BoxPoolImpl<$data_type> = $crate::pool::boxed::BoxPoolImpl::new(); - &POOL + &$name } } diff --git a/src/pool/object.rs b/src/pool/object.rs index a3d374c907..16364a470e 100644 --- a/src/pool/object.rs +++ b/src/pool/object.rs @@ -88,10 +88,13 @@ macro_rules! object_pool { type Data = $data_type; fn singleton() -> &'static $crate::pool::object::ObjectPoolImpl<$data_type> { - static POOL: $crate::pool::object::ObjectPoolImpl<$data_type> = + // Even though the static variable is not exposed to user code, it is + // still useful to have a descriptive symbol name for debugging. + #[allow(non_upper_case_globals)] + static $name: $crate::pool::object::ObjectPoolImpl<$data_type> = $crate::pool::object::ObjectPoolImpl::new(); - &POOL + &$name } }