Repository navigation
tri mods orphan: a one-line #[path = ..] .. mod x; binds its own mod, not the next line (Closes #10936) - #10950
Merged
Merged
Conversation
… not the next line's (Closes #10936) #10819 wrote the SPICE and Zig mounts of cli/tri/src/main.rs as `#[path = ".."] #[allow(..)] mod spice; // ..` on one line. edges_from() stored the path and skipped the rest of the line, so `mod spice;` and `mod zig;` were never read and the stored path landed on `mod renum;`: renum.rs (26 tests) was reported orphaned and the reachability check went red on master. After a #[path] attribute the rest of the same line is now read for a `mod` declaration. The existing test a_path_attribute_does_not_carry_to_a_later_unrelated_mod takes the one-line form and asserts the same-line binding; with the old parser it fails. `tri mods orphan --gate` on master: cli/tri 54 of 54 compiled, 0 orphaned. Hand lines +6/-6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 19, 2026 08:12
Contributor
9 of 12 tasks
This was referenced Oct 19, 2026
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.
Closes #10936. Repairs a red on master that #10819 (mine, lane B1 of #10522) introduced.
Cause.
edges_fromincli/tri/src/modreach.rsreads a crate root line by line; a line starting with#[path = ".."]stored the path and skipped the rest of the line. #10819 wrote the SPICE and Zig mounts in the valid one-line form#[path = ".."] #[allow(..)] mod spice; // .., somod spice;/mod zig;were never read and the stored path was applied to the next line'smod renum;:cli/tri/src/renum.rs(26 tests) was reported orphaned.Fix. After a
#[path]attribute, the rest of the same line (after the last], before a//comment) is read for amoddeclaration. Theinclude!branch is written as one statement, so hand lines are +6 / -6 (own-language budget rc=0 locally).Evidence.
cargo test --release -p tri modreach: 7 passed.a_path_attribute_does_not_carry_to_a_later_unrelated_modnow uses the one-line form and asserts the same-line binding; with the old parser it fails (panicked at cli/tri/src/modreach.rs:555).tri mods orphan --gateon master with the fixed binary:cli/tri 54 files under src/, 54 compiled, 0 orphaned (+2 reached outside src/ via #[path]).🤖 Generated with Claude Code