summaryrefslogtreecommitdiffstats
path: root/mm/init-mm.c
diff options
context:
space:
mode:
authorBenno Lossin <benno.lossin@proton.me>2023-08-14 10:46:48 +0200
committerMiguel Ojeda <ojeda@kernel.org>2023-08-21 14:31:48 +0200
commit97de919d574e6a22f0d43a169b96274f1862e770 (patch)
treeab4443461c6e42b890802f2b5e13c184c7f69406 /mm/init-mm.c
parentrust: add derive macro for `Zeroable` (diff)
downloadlinux-97de919d574e6a22f0d43a169b96274f1862e770.tar.xz
linux-97de919d574e6a22f0d43a169b96274f1862e770.zip
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 <lina@asahilina.net> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20230814084602.25699-5-benno.lossin@proton.me [ Cleaned a few trivial nits. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'mm/init-mm.c')
0 files changed, 0 insertions, 0 deletions