Re: [PATCH v2 03/12] rust: init: make guards in the init macros hygienic

From: Martin Rodriguez Reboredo
Date: Thu Jul 20 2023 - 20:25:23 EST


On 7/19/23 11:20, Benno Lossin wrote:
Use hygienic identifiers for the guards instead of the field names. This
makes the init macros feel more like normal struct initializers, since
assigning identifiers with the name of a field does not create
conflicts.
Also change the internals of the guards, no need to make the `forget`
function `unsafe`, since users cannot access the guards anyways. Now the
guards are carried directly on the stack and have no extra `Cell<bool>`
field that marks if they have been forgotten or not, instead they are
just forgotten via `mem::forget`.

Suggested-by: Asahi Lina <lina@xxxxxxxxxxxxx>
Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
---
[...]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>