diff options
author | Benno Lossin <[email protected]> | 2023-08-14 08:46:48 +0000 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2023-08-21 14:31:48 +0200 |
commit | 97de919d574e6a22f0d43a169b96274f1862e770 (patch) | |
tree | ab4443461c6e42b890802f2b5e13c184c7f69406 /tools/perf/scripts | |
parent | 071cedc84e907f6984b3de3285ec2b077d3c3cdb (diff) |
rust: init: make guards in the init macros hygienic
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 <[email protected]>
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Signed-off-by: Benno Lossin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Cleaned a few trivial nits. ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions