rust: pin-init: allow `pub` fields in `derive(Zeroable)`
authorBenno Lossin <benno.lossin@proton.me>
Mon, 21 Apr 2025 22:18:33 +0000 (22:18 +0000)
committerBenno Lossin <benno.lossin@proton.me>
Thu, 1 May 2025 16:14:46 +0000 (18:14 +0200)
Add support for parsing `pub`, `pub(crate)` and `pub(super)` to the
derive macro `Zeroable`.

Link: https://github.com/Rust-for-Linux/pin-init/pull/42/commits/e8311e52ca57273e7ed6d099144384971677a0ba
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
rust/pin-init/src/macros.rs

index 361623324d5cf131b5a6a129d502d3c8c00389e2..e4054fe3ed3df79f3c5a0e497f18bfe50f4d8c66 100644 (file)
@@ -1393,7 +1393,7 @@ macro_rules! __derive_zeroable {
         @body({
             $(
                 $(#[$($field_attr:tt)*])*
-                $field:ident : $field_ty:ty
+                $field_vis:vis $field:ident : $field_ty:ty
             ),* $(,)?
         }),
     ) => {