Skip to content

fix(warnings): gate feature- and platform-specific dead code across rune and procwatch - #2370

Merged
Hona merged 1 commit into
devfrom
fix/noticed-feature-gate-warnings
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
fix/noticed-feature-gate-warnings

Conversation

@Hona

@Hona Hona commented Nov 25, 2026

Copy link
Copy Markdown
Member

Summary

Gates eight feature- and platform-specific dead-code items found by sweeping crates/rune, crates/rune-kit, and crates/procwatch across default, --no-default-features, and individual optional feature sets on Linux, macOS, Windows, and wasm32 (with no blanket #[allow(dead_code)]).

  • crates/rune/src/open_path.rs:203 (file_uri_from_bytes): gate with feature = "dbus" alongside test (Linux non-dbus builds).
  • crates/rune/src/platform/preferences.rs:77 (DEFAULT_DOUBLE_CLICK_SECS): gate with all(target_os = "linux", feature = "dbus") alongside test (Linux non-dbus builds).
  • crates/rune/src/window/titlebar/linux.rs:82 (Sides::ALL): gate with #[cfg(test)] (used only by linux_tests.rs).
  • crates/rune/src/frame/live_log.rs:28,33,55,192 (CAPTURED / capture_frames): gate with #[cfg(all(test, target_os = "windows"))] (used only by Win32 resize_sync/tests.rs under frame-profile).
  • crates/procwatch/src/alloc/sites.rs:222,271,413,418 (report, unsampled, os::modules, os::nt_heaps): gate Windows-only sampling tables and dumper behind #[cfg(windows)] with clean #[cfg(not(windows))] no-op stubs (Linux/macOS alloc-sites builds).

Verification

  • Linux (check-linux.sh --warn): 0 repo warnings across default, --no-default-features, --no-default-features --all-targets, every single optional feature of rune alone on top of no defaults (accessibility, dbus, embedded-fonts, hunspell, ogg-audio, svg, tooling, keys-overlay, frame-profile, alloc-sites, native-file-dialog, hot, test-gpu-counters, test-gpu-noop, baseline-taffy, avif), and every feature set of rune-kit (default, no-default, markdown, mermaid, math, frame-profile).
  • macOS (check.sh --config build.rustflags=[]): 0 repo warnings across rune and rune-kit feature sets plus unit tests.
  • Windows & wasm32: 0 repo warnings across all feature sets, cargo check --workspace --all-targets, cargo check-win-material, cargo lint-wasm, cargo lint-webgl, cargo test -p procwatch --features alloc-sites, and cargo test -p rune --lib + --test integration.

…une and procwatch

A feature-set warning sweep across Linux, macOS, Windows, and wasm32 found
eight dead-code warnings under optional and non-default feature sets:

- `crates/rune/src/open_path.rs:203` (`file_uri_from_bytes`, added in #1947):
  used on Unix only under `feature = "dbus"` (FileManager1) and tests; gate
  with `feature = "dbus"` alongside `test`.
- `crates/rune/src/platform/preferences.rs:77` (`DEFAULT_DOUBLE_CLICK_SECS`,
  added in #1923/#2128): used on Linux only under `feature = "dbus"` and tests;
  gate with `all(target_os = "linux", feature = "dbus")` alongside `test`.
- `crates/rune/src/window/titlebar/linux.rs:82` (`Sides::ALL`, added in #2244):
  used only in `linux_tests.rs`; gate with `#[cfg(test)]`.
- `crates/rune/src/frame/live_log.rs:33` (`CAPTURED` / `capture_frames`, added
  in #2309): used only in `window/win32/resize_sync/tests.rs` under
  `frame-profile`; gate with `#[cfg(all(test, target_os = "windows"))]`.
- `crates/procwatch/src/alloc/sites.rs:222,271,413,418` (`report`, `unsampled`,
  `os::modules`, `os::nt_heaps`, added in #744): `alloc-sites` sampling and
  dumper are Windows-only; gate the implementation behind `#[cfg(windows)]`
  with clean `#[cfg(not(windows))]` no-op stubs.
@Hona
Hona merged commit 4071680 into dev Nov 25, 2026
2 checks passed
@Hona
Hona deleted the fix/noticed-feature-gate-warnings branch November 25, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant