Repository navigation
fix(affected): follow a Rust path through a re-exported module - #97
Merged
Merged
Conversation
A crate that re-exports another crate whole (`pub use parts::*`) names that crate's modules as its own: `crate::ports::Runner`. The path stopped at the crate root, so the trait counted as one the workspace does not declare, and a change to any method implementing it reached every definition that uses the crate root. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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.
What
--relatednow follows a Rust path through a module that another module re-exports.Before,
crate::ports::Runnerstopped atapp/src/lib.rs, becauseportsis not a module ofapp. Two things followed:Runnercounted as a trait the workspace does not declare, sorunwas treated likeDisplay::fmt: a change to it reached every definition that uses the type's file.crate::ports::…counted as a user of the crate root.Now the path continues into
parts::ports, for a glob re-export and for a named one (pub use parts::ports;).Effect
Measured on a private polyglot monorepo whose main crate re-exports a sibling crate this way:
get,collect,contains,lock) on values whose type is not written. That is a separate limit and is not addressed here.Tests
rust_paths_are_followed_through_a_glob_re_export_of_another_crate(fails without the change: an unrelated test in the same crate is selected).cargo test: all pass exceptdev_services::dynamic_port_bundles_are_distinct_propagated_and_released, which fails the same way onmainon my machine.cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.🤖 Generated with Claude Code