Re: [PATCH RFC] rust: maple_tree: implement Send and Sync for MapleTree

From: Daniel Almeida

Date: Mon Apr 20 2026 - 18:02:18 EST


Hi Joel,

I think there are others in a better position to review this than me,
however, while reading this patch, I noticed this:
>
> #[inline]
> @@ -302,19 +305,31 @@ fn drop(mut self: Pin<&mut Self>) {
> }
> }
>
> +// SAFETY: `MapleTree<T>` is `Send` iff `T` is `Send`. All access to the tree
> +// goes through the internal `ma_lock` spinlock or via `&mut MapleTree`.
> +unsafe impl<T: ForeignOwnable + Send> Send for MapleTree<T> {}
> +// SAFETY: All shared access through `&MapleTree` either acquires `ma_lock`.

^ Missing something here? Either … or?

— Daniel