[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230720131648.3542031-1-aliceryhl@google.com>
Date: Thu, 20 Jul 2023 13:16:48 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: benno.lossin@...ton.me
Cc: alex.gaynor@...il.com, aliceryhl@...gle.com,
bjorn3_gh@...tonmail.com, boqun.feng@...il.com, gary@...yguo.net,
lina@...hilina.net, linux-kernel@...r.kernel.org, nmi@...aspace.dk,
ojeda@...nel.org, rust-for-linux@...r.kernel.org,
wedsonaf@...il.com
Subject: Re: [PATCH v2 03/12] rust: init: make guards in the init macros hygienic
Benno Lossin <benno.lossin@...ton.me> writes:
> 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@...hilina.net>
> Signed-off-by: Benno Lossin <benno.lossin@...ton.me>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Powered by blists - more mailing lists