Skip to content

windows-reactor improved dead code detection - #4585

Merged
Kenny Kerr (kennykerr) merged 12 commits into
masterfrom
minimal-pub-crate
Jun 16, 2026
Merged

windows-reactor improved dead code detection#4585
Kenny Kerr (kennykerr) merged 12 commits into
masterfrom
minimal-pub-crate

Conversation

@kennykerr

@kennykerr Kenny Kerr (kennykerr) commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

The most effective way seems to be to use pub(crate) on functions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates windows-bindgen’s --minimal output and the reactor filter lists to improve trimming and dead-code visibility in generated bindings, then refreshes the relevant expected/generated outputs across reactor, canvas, and animation.

Changes:

  • Emit pub(crate) methods (and delegate constructors) in --minimal bindings to make unused APIs detectable by dead_code within the generating crate.
  • Make minimal-mode method inclusion overload-aware (match overload-disambiguated names only) and refine minimal filtering around activation/constructors.
  • Update reactor filter lists and regenerate expected outputs/bindings to match the new codegen behavior.

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/tools/reactor/src/test.txt Adds additional WinUI APIs used by selftests (attached properties, tooltip, etc.).
crates/tools/reactor/src/base.txt Updates filter entries for overload-disambiguated method names and trims unused entries.
crates/tests/libs/bindgen/data/bindgen/minimal/expected.rs Updates expected minimal bindgen output for new pub(crate) visibility.
crates/tests/libs/bindgen/data/bindgen/auto_events/expected.rs Updates expected event wrapper output for new pub(crate) visibility and formatting.
crates/libs/reactor/src/lib.rs Allows dead_code within the private bindings module.
crates/libs/canvas/src/bindings.rs Regenerated minimal bindings with pub(crate) method visibility.
crates/libs/bindgen/src/types/method.rs Implements pub(crate) visibility for minimal WinRT method wrappers; refactors composable emission.
crates/libs/bindgen/src/types/interface.rs Threads new emit_compose parameter into method emission.
crates/libs/bindgen/src/types/delegate.rs Makes delegate new() pub(crate) under --minimal.
crates/libs/bindgen/src/types/cpp_method.rs Implements pub(crate) visibility for minimal Win32/CPP interface methods.
crates/libs/bindgen/src/types/class.rs Adds compose gating for minimal + --implement and gates default ctor emission via minimal filter.
crates/libs/bindgen/src/minimal_type_map.rs Aligns type-closure inclusion with overload-aware minimal filtering.
crates/libs/bindgen/src/minimal_filter.rs Adds activatable tracking and adjusts class/interface expansion behavior.
crates/libs/bindgen/src/config.rs Changes minimal-mode method matching to be overload-name specific when applicable.
crates/libs/animation/src/bindings.rs Regenerated minimal bindings with pub(crate) method visibility.

Comment thread crates/libs/bindgen/src/types/method.rs
Comment thread crates/libs/bindgen/src/types/cpp_method.rs
Comment thread crates/libs/bindgen/src/types/delegate.rs
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.

2 participants