Re: [PATCH v1 1/2] rust: Add support for calling a function exactly once

Miguel Ojeda
2025-11-10T16:37:30Z

On Mon, Nov 10, 2025 at 5:15 PM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> // ORDERING: Relaxed is fine because we don't expect
> // synchronization here.
> let old = self.init.xchg(1, Relaxed);

Meta-comment: I like these `// ORDERING: ...` comments -- I will add
them to the other ones we are getting implemented in Clippy (`//
PANIC: ...`, `// CAST: ...`), i.e. we can request them when calling
certain methods.

Well, unless you think it is a bad idea for some reason -- I guess in
some cases they may be obvious, but just like `unsafe`, even "obvious"
ones may not be as obvious as one may initially think... :)

Cheers,
Miguel