about summary refs log tree commit diff
path: root/library/std/src/sync
diff options
context:
space:
mode:
authorTony Yang <tony@tony.tc>2021-10-26 11:34:03 +0100
committerTony Yang <tony@tony.tc>2021-10-26 11:34:03 +0100
commitf54663767d205ebcc2eb7630f63dfea99e4add31 (patch)
tree2e74eb8c6079d5ca5e5a21b8a688e1b6e53dd96d /library/std/src/sync
parent29b1248025b19bd132c8047fc710ea9314b9b76b (diff)
downloadrust-f54663767d205ebcc2eb7630f63dfea99e4add31.tar.gz
rust-f54663767d205ebcc2eb7630f63dfea99e4add31.zip
Remove redundant Aligner
The `Aligner` struct seems to be unnecessary.
Previously noted by @arthurprs https://github.com/rust-lang/rust/pull/44963#discussion_r145340754
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
Diffstat (limited to 'library/std/src/sync')
-rw-r--r--library/std/src/sync/mpsc/cache_aligned.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/library/std/src/sync/mpsc/cache_aligned.rs b/library/std/src/sync/mpsc/cache_aligned.rs
index b0842144328..f95b0ddd589 100644
--- a/library/std/src/sync/mpsc/cache_aligned.rs
+++ b/library/std/src/sync/mpsc/cache_aligned.rs
@@ -2,10 +2,7 @@ use crate::ops::{Deref, DerefMut};
 
 #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[repr(align(64))]
-pub(super) struct Aligner;
-
-#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
-pub(super) struct CacheAligned<T>(pub T, pub Aligner);
+pub(super) struct CacheAligned<T>(pub T);
 
 impl<T> Deref for CacheAligned<T> {
     type Target = T;
@@ -22,6 +19,6 @@ impl<T> DerefMut for CacheAligned<T> {
 
 impl<T> CacheAligned<T> {
     pub(super) fn new(t: T) -> Self {
-        CacheAligned(t, Aligner)
+        CacheAligned(t)
     }
 }