Re: [PATCH v4 1/3] rust: revocable: update write invariant and fix safety comments

Marcelo Moreira
2025-06-26T16:59:27Z

Em ter., 17 de jun. de 2025 às 04:18, Benno Lossin <lossin@kernel.org> escreveu:
>
> On Tue Jun 17, 2025 at 4:49 AM CEST, Marcelo Moreira wrote:
> > Em seg., 16 de jun. de 2025 às 04:15, Benno Lossin <lossin@kernel.org> escreveu:
> >> How about:
> >>
> >> // - `self.data` is valid for writes because of `Self`'s type invariants:
> >> // `&mut Self` guarantees exclusive access, thus no other thread can concurrently access `data`.
> >> // - this function is a drop function, thus this code is at most executed once.
> >
> > Ok! =)
> >
> > I thought about using "so" instead of the first "thus" so I wouldn't
> > have to repeat the use of "thus" so many times.
>
> I personally don't care about repeating those "filler" words in safety
> documentation. The clearer it is the better :)
>

Ok, thanks Benno!

> > Final version:
> > // - `self.data` is valid for writes because of `Self`'s type invariants:
> > // `&mut Self` guarantees exclusive access, so no other thread can
> > concurrently access `data`.
> > // - this function is a drop function, thus this code is at most executed once.
>
> That is fine too.

Thanks!

Guys, sorry for the delay in replying. I traveled to my parents' house
to visit them :)

I'm sending v5 now!

---
Cheers,
Marcelo Moreira