From 4860315ae9d43df89204c822fdee71027f34d25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 5 Aug 2026 13:11:49 +0200 Subject: [PATCH] fix(warnings): SubmodBucket dead-code warning from #7433 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #7433 put `node:test` behind `mod-node-test` but left the `SubmodBucket::Test` and `::TestReporters` variants ungated — they carry the discriminants that size and index `SUBMOD_REGISTRY`, so removing them would shift every other bucket. With the feature off they are never constructed, and `cargo check -p perry-runtime --no-default-features --features full` reports: warning: variants `Test` and `TestReporters` are never constructed The variants must stay for their discriminants, so mark the enum `allow(dead_code)` only in that configuration. Default builds are unchanged. --- changelog.d/7440-submod-bucket-dead-code.md | 1 + crates/perry-runtime/src/node_submodules/mod.rs | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/7440-submod-bucket-dead-code.md diff --git a/changelog.d/7440-submod-bucket-dead-code.md b/changelog.d/7440-submod-bucket-dead-code.md new file mode 100644 index 0000000000..be0d176a33 --- /dev/null +++ b/changelog.d/7440-submod-bucket-dead-code.md @@ -0,0 +1 @@ +fix(warnings): silence the `SubmodBucket::Test`/`TestReporters` dead-code warning that #7433 introduced in `--no-default-features` builds. diff --git a/crates/perry-runtime/src/node_submodules/mod.rs b/crates/perry-runtime/src/node_submodules/mod.rs index 71e1c82534..04afbb49bb 100644 --- a/crates/perry-runtime/src/node_submodules/mod.rs +++ b/crates/perry-runtime/src/node_submodules/mod.rs @@ -758,6 +758,9 @@ static SUBMOD_TEST_REPORTERS: SubmoduleSpec = SubmoduleSpec { use std::sync::atomic::AtomicPtr; #[derive(Copy, Clone)] #[repr(usize)] +// `Test`/`TestReporters` keep their discriminants (they size and index +// `SUBMOD_REGISTRY`) but are only constructed under `mod-node-test`. +#[cfg_attr(not(feature = "mod-node-test"), allow(dead_code))] enum SubmodBucket { Vm, Timers,