From 68b03d69c06d9325ba6995955fd9a3b62090d39d Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Wed, 6 Sep 2023 08:46:58 +0200 Subject: [PATCH] Downgrade int_like const fn default to trait. --- src/common/int_like.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/int_like.rs b/src/common/int_like.rs index 18981bbc7a..8e6b20b1ae 100644 --- a/src/common/int_like.rs +++ b/src/common/int_like.rs @@ -72,12 +72,6 @@ macro_rules! int_like { container: $backing_atomic_type::new(x.get()) } } - // TODO: Rename/replace with Default trait? - #[allow(dead_code)] - #[inline] - pub const fn default() -> Self { - Self::new($new_type_name::new(0)) - } #[allow(dead_code)] #[inline] pub fn load(&self, order: ::core::sync::atomic::Ordering) -> $new_type_name { @@ -110,6 +104,12 @@ macro_rules! int_like { } } } + impl ::core::default::Default for $new_atomic_type_name { + #[inline] + fn default() -> Self { + Self::new($new_type_name::new(0)) + } + } } }