windows-reactor improved dead code detection - #4585
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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--minimalbindings to make unused APIs detectable bydead_codewithin 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. |
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.
The most effective way seems to be to use
pub(crate)on functions.