Re: [PATCH] rust: maple_tree: implement Send and Sync for MapleTree
From: Alice Ryhl
Date: Tue Sep 08 2026 - 05:01:11 EST
On Tue, Sep 8, 2026 at 9:51 AM Eliot Courtney <ecourtney@xxxxxxxxxx> wrote:
> +// SAFETY: `&MapleTree<T>` never hands out `&T`; all entry access is serialized
> +// by `ma_lock` or `&mut Guard`, so `T: Send` suffices (`T: Sync` not required).
> +unsafe impl<T: ForeignOwnable + Send> Sync for MapleTree<T> {}
This is true now, but will change if load_rcu() from
https://lore.kernel.org/all/20260116-rcu-box-v1-2-38ebfbcd53f0@xxxxxxxxxx/
got merged.
It might be better to just pre-emptively require T: Sync now?
Alice