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)) + } + } } }