[PATCH 1/3] rust: pin-init: internal: allow `clippy::large_unopt_stack_frames`
From: Gary Guo
Date: Wed Nov 18 2026 - 09:31:44 EST
From: Gary Guo <gary@xxxxxxxxxxx>
Since Rust 1.102, Clippy renames `large_stack_frames` to
`large_unopt_stack_frames` and make it warn by default. This is a good
thing as in such cases pin-init should be used rather than potentially
leave unoptimized large moves on stack. However, this also triggers in
unexecutable code paths that pin-init generates for field duplication and
exhaustiveness checks. Allow it on the generated check closure.
Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
---
rust/pin-init/internal/src/init.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/pin-init/internal/src/init.rs b/rust/pin-init/internal/src/init.rs
index ded2b5283376..c78f8d3ca309 100644
--- a/rust/pin-init/internal/src/init.rs
+++ b/rust/pin-init/internal/src/init.rs
@@ -572,7 +572,7 @@ fn make_field_check(
};
quote_spanned! { Span::mixed_site() =>
- #[allow(unreachable_code)]
+ #[allow(unreachable_code, clippy::large_unopt_stack_frames)]
// We use unreachable code to perform field checks. They're still checked by the compiler.
// SAFETY: this code is never executed.
let _ = || unsafe {
--
2.54.0