Skip to content

Commit b623e70

Browse files
committed
Add #[inline] to fmt impls
rust-lang/rust#117727
1 parent 2b9c48a commit b623e70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,15 +1406,15 @@ impl<T> From<*mut T> for AtomicPtr<T> {
14061406
}
14071407

14081408
impl<T> fmt::Debug for AtomicPtr<T> {
1409-
#[allow(clippy::missing_inline_in_public_items)] // fmt is not hot path
1409+
#[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
14101410
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14111411
// std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
14121412
fmt::Debug::fmt(&self.load(Ordering::Relaxed), f)
14131413
}
14141414
}
14151415

14161416
impl<T> fmt::Pointer for AtomicPtr<T> {
1417-
#[allow(clippy::missing_inline_in_public_items)] // fmt is not hot path
1417+
#[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
14181418
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14191419
// std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
14201420
fmt::Pointer::fmt(&self.load(Ordering::Relaxed), f)

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ macro_rules! const_fn {
130130
macro_rules! impl_debug_and_serde {
131131
($atomic_type:ident) => {
132132
impl fmt::Debug for $atomic_type {
133-
#[allow(clippy::missing_inline_in_public_items)] // fmt is not hot path
133+
#[inline] // fmt is not hot path, but #[inline] on fmt seems to still be useful: https://github.com/rust-lang/rust/pull/117727
134134
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
135135
// std atomic types use Relaxed in Debug::fmt: https://github.com/rust-lang/rust/blob/1.70.0/library/core/src/sync/atomic.rs#L2024
136136
fmt::Debug::fmt(&self.load(Ordering::Relaxed), f)

0 commit comments

Comments
 (0)