Repository navigation
fix(mcp): exported-only Rust outlines leave out impl blocks of private types (#1587) - #1649
Merged
Merged
Conversation
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.
Problem
code_outlinewithexported_onlytreats a Rustimplblock as transparent (#1418): it passes on its owners' visibility, which at the top level is none. So forthe outline left
Hiddenout but listedimpl Hiddenandnew, which nothing outside the crate can reach (#1587).Change
tools/outline/render.rs:implheader is read for its trait and self type byimpl_types, which takes each by its last path segment, skips generics, and stops atwhere/{. Examples:impl<T: Clone> Shown<T>→Shown;impl fmt::Display for W<'a>→DisplayandW.Reproduce and verify
New test
tests/outline_exported_owners.rs::an_impl_of_a_private_type_exports_none_of_its_members.impl Hidden'snewis left out, andimpl<T: Clone> Shown<T>'sgetis listed.Before (the check disabled, a Linux build node):
After: passes. The two existing tests in that file still pass.
Measurements
None.
Checks
One gate on a Linux build node (default stable toolchain) covered this PR together with #1582, the other mcp fix merged with it. The two change disjoint files.
cargo test -p prod-code-mcp --no-fail-fast: exit 101. 134 of 134 binaries ran. The one failed target is--test encapsulate_preservation(context_review::rust_consuming_receiver_keeps_unconditional_rhs), the known environment failure of Two prod-code-mcp tests depend on the build node: /tmp as a workspace root and an unconditional zig probe #1567, unrelated.cargo clippy -p prod-code-mcp --all-targets: exit 0. The one warning in a touched file,collapsible_ifattools/symbols/resolve.rs:367, is on a pre-existing line (main's line 361, moved by this change).cargo fmt --all -- --check: exit 0.Closes #1587