Files
Boqun Feng bec2fa23ea rust: sync: atomic: Remove bound T: Sync for Atomic::from_ptr()
[ Upstream commit 4a5dc632e0 ]

Originally, `Atomic::from_ptr()` requires `T` being a `Sync` because I
thought having the ability to do `from_ptr()` meant multiplle
`&Atomic<T>`s shared by different threads, which was identical (or
similar) to multiple `&T`s shared by different threads. Hence `T` was
required to be `Sync`. However this is not true, since `&Atomic<T>` is
not the same at `&T`. Moreover, having this bound makes `Atomic::<*mut
T>::from_ptr()` impossible, which is definitely not intended. Therefore
remove the `T: Sync` bound.

[boqun: Fix title typo spotted by Alice & Gary]

Fixes: 29c32c405e ("rust: sync: atomic: Add generic atomics")
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260120115207.55318-2-boqun.feng@gmail.com
Link: https://patch.msgid.link/20260303201701.12204-2-boqun@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-05-23 13:06:25 +02:00
..
2025-10-17 13:02:22 +02:00
…
…
2025-08-13 17:40:28 +02:00
…
2025-09-06 13:27:20 +02:00
…
…
…
…
2025-08-21 16:58:07 +02:00
2025-09-22 23:55:41 +02:00
…
2025-09-15 09:38:35 +02:00
…
…