From e7feb1f3b3bca1a8ad7046f2f1af601bc95108fb Mon Sep 17 00:00:00 2001 From: Alexandre Courbot Date: Mon, 15 Dec 2025 22:24:25 +0900 Subject: [PATCH] rust: pin-init: allow `dead_code` on projection structures Projection structures are not necessarily (and often not) used in their entirety. At the moment partial uses result in warnings about the unused members. Discard them by allowing `dead_code` on the projection structure Signed-off-by: Alexandre Courbot --- src/macros.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/macros.rs b/src/macros.rs index 682c61a5..fe60e570 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1004,6 +1004,7 @@ macro_rules! __pin_data { @not_pinned($($(#[$($attr:tt)*])* $fvis:vis $field:ident : $type:ty),* $(,)?), ) => { $crate::macros::paste! { + #[allow(dead_code)] #[doc(hidden)] $vis struct [< $name Projection >] <'__pin, $($decl_generics)*> { $($(#[$($p_attr)*])* $pvis $p_field : ::core::pin::Pin<&'__pin mut $p_type>,)*