Repository navigation
fix(ffi): resolve an exclude's crate path when checking what a cfg left out - #894
Conversation
configured_out resolved a path only from the facade's root, so an exclude naming a type by its defining crate's path, the form the walk counts a type no facade module re-exports under, refused on a build whose cfg drops it, as moq_tokio::server::Streams::unix does on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. configured_out now resolves an exclude both from the facade's root and from the root of each linked crate named by the first segment. That matches the <crate_name>::<public path> key walk_reach already uses for types the root doesn't reach, so the fix targets the cause.
Reviewed changes: I reviewed all three commits, covering the driver fix, the fixture extension and the README note.
configured_outsplit intostripped_under: the old per-module walk now runs once fromLOCAL_CRATEand once from each crate whosecrate_namematchessegments[0](any linked version), usingsegments[1..]. A single-segment path gives an empty slice and correctly returnsfalse.- Fixture
configured_out: the facade's glob module is renamed fromdeptoglob, sodep::...now names the dependency crate itself. The fixture checks thatdep::Size::depth(a#[cfg(any())]field) passes and thatdep::Size::missingstill errors. - README: the config comment now names the crate-path exclude form.
claude-opus-5-5 | 𝕏
Merging this PR will degrade performance by 13.55%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |

An exclude may name a type no facade module re-exports by its defining crate's path (
moq_tokio::server::Streams::unix), the form the walk counts such a type under since kixel-ai/rust2#721. When acfgdrops what it names, the driver asksconfigured_outwhether the exclude names a configured-out item, butconfigured_outresolved paths only from the facade's root, so the export refused with "names nothing exported". moq's stand-in hits this on Windows, whereStreams::unixis#[cfg(unix)].configured_outnow also resolves the path from the root of each linked crate whosecrate_nameis its first segment (any of several versions), matchingwalk_reach'stcx.crate_namekey. The README's config comment names the crate-path form.Caused by
configured_out(from kixel-ai/rust2#607) to resolve it (found by check). kixel-ai/rust2#881'smoq_tokio::server::Streams::unixexclude exposed it on the Windows API stage (run).Validation
configured_outinffi/tests/fixtures.rs: the facade's glob module is renamed fromdeptoglobsodep::...names the dependency crate itself;dep::Size::depth(a#[cfg(any())]field) must pass anddep::Size::missingmust still error. Before the fix it failed with an extra "excludedep::Size::depth... names nothing exported"; after, it passes.just cipasses.Public API
None. An exclude by a crate path now passes on a build whose
cfgleaves its item out, as one by a facade path already did.Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 2655968
Base: origin/main at 84bfd7c
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f5c4-ec93-72c2-b3c3-b0d681ad9aa0, round 1Score: 9/10,
The change preserves facade-relative lookup while extending defining-crate lookup, with relevant fixture coverage and no actionable defects found by inspection, though tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1f5c4-ec93-7c03-989a-d49a281c96be, round 1Score: 9/10,
No actionable defects were found by code inspection, but readiness remains pending execution of the regression tests; builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Summary by CodeRabbit
Bug Fixes
Documentation