From e5b1f69d631d6637e51f3715e8276f2c57676361 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Sun, 1 Nov 2020 04:38:41 +0000 Subject: [PATCH] Inline Default::default() for atomics --- library/core/src/sync/atomic.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs index 5c9cfe27101f0..a3d93d7074b69 100644 --- a/library/core/src/sync/atomic.rs +++ b/library/core/src/sync/atomic.rs @@ -155,6 +155,7 @@ pub struct AtomicBool { #[stable(feature = "rust1", since = "1.0.0")] impl Default for AtomicBool { /// Creates an `AtomicBool` initialized to `false`. + #[inline] fn default() -> Self { Self::new(false) } @@ -1212,6 +1213,7 @@ macro_rules! atomic_int { #[$stable] impl Default for $atomic_type { + #[inline] fn default() -> Self { Self::new(Default::default()) }