Repository navigation
fix(warnings): gate feature- and platform-specific dead code across rune and procwatch - #2370
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gates eight feature- and platform-specific dead-code items found by sweeping
crates/rune,crates/rune-kit, andcrates/procwatchacross default,--no-default-features, and individual optional feature sets on Linux, macOS, Windows, andwasm32(with no blanket#[allow(dead_code)]).crates/rune/src/open_path.rs:203(file_uri_from_bytes): gate withfeature = "dbus"alongsidetest(Linux non-dbusbuilds).crates/rune/src/platform/preferences.rs:77(DEFAULT_DOUBLE_CLICK_SECS): gate withall(target_os = "linux", feature = "dbus")alongsidetest(Linux non-dbusbuilds).crates/rune/src/window/titlebar/linux.rs:82(Sides::ALL): gate with#[cfg(test)](used only bylinux_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 Win32resize_sync/tests.rsunderframe-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/macOSalloc-sitesbuilds).Verification
check-linux.sh --warn): 0 repo warnings across default,--no-default-features,--no-default-features --all-targets, every single optional feature ofrunealone 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 ofrune-kit(default,no-default,markdown,mermaid,math,frame-profile).check.sh --config build.rustflags=[]): 0 repo warnings acrossruneandrune-kitfeature sets plus unit tests.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, andcargo test -p rune --lib+--test integration.