Re: [PATCH v8 3/5] rust: add bitmap API.

From: Miguel Ojeda
Date: Mon May 19 2025 - 17:47:34 EST


On Mon, May 19, 2025 at 10:08 PM Burak Emir <bqe@xxxxxxxxxx> wrote:
>
> The "unsafe" here should serve as reminder to argue why it is ok to
> not have any ordering guarantees.

`unsafe` should be used for unsafe functions, not as a general
"danger" or "advanced" marker.

(Having such a marker could be useful, but `unsafe fn` is not it)

> The last sentence is supposed to say: when you have a &mut bitmap, you
> can reborrow it as &bitmap, and then happily call this atomic op.
> Even though it is unnecessary.

I don't think that is related to safety preconditions. A "# Safety"
section is intended to explain what the preconditions are.

So, for instance, stating "The caller must ensure that this is safe"
does not add much.

Cheers,
Miguel