Skip to content

Commit 3c8f001

Browse files
committed
Auto merge of #90284 - tonyyzy:patch-1, r=JohnTitor
Remove redundant Aligner The `Aligner` struct seems to be unnecessary. Previously noted by `@arthurprs` #44963 (comment) Reddit discussion: https://www.reddit.com/r/rust/comments/pfvvz2/aligner_and_cachealigned/ Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa7ca554922755f9d1b62b017d785c6f
2 parents c7a30c8 + f546637 commit 3c8f001

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

library/std/src/sync/mpsc/cache_aligned.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ use crate::ops::{Deref, DerefMut};
22

33
#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
44
#[repr(align(64))]
5-
pub(super) struct Aligner;
6-
7-
#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
8-
pub(super) struct CacheAligned<T>(pub T, pub Aligner);
5+
pub(super) struct CacheAligned<T>(pub T);
96

107
impl<T> Deref for CacheAligned<T> {
118
type Target = T;
@@ -22,6 +19,6 @@ impl<T> DerefMut for CacheAligned<T> {
2219

2320
impl<T> CacheAligned<T> {
2421
pub(super) fn new(t: T) -> Self {
25-
CacheAligned(t, Aligner)
22+
CacheAligned(t)
2623
}
2724
}

0 commit comments

Comments
 (0)