Repository navigation
Conversation
- module_cfg_predicates: cfg-disjoint twin `mod` declarations of one module are ORed (`any(all(..), all(..))`), not ANDed into an always-false predicate; an ungated declaration loads the module in every build and gates nothing. - #[path] trees: an ungated #[path] module loads only its target in every build, so a test-gated child of it stays test-only. The children of a #[path] target are walked from its own `mod` declarations with rustc's directory rules (a non-mod.rs target owns the directory beside it), replacing the directory-prefix test. - Every file that declares a `mod` is read for ungated `mod` and #[path] declarations, not only files with cfg and test text. A declaration counts only when its declaring file is itself loaded in every build. - Tests for each finding, including the twin route mounted under the any(...) predicate on the slow path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crate scan in test_scope applied its own stem rule to an inline #[path] inside a path-loaded non-mod-rs file (`beside/support.rs` names `beside/support/inner/..`), while rustc resolves it beside the file (`beside/inner/..`). Every #[path] target now comes from path_tree's walk from lib.rs / main.rs, the same resolver the module trees use, so the stem rule and the per-file directory guess are gone. The gated mod-name scan keeps only by-name chains. Test: inline_path_of_a_path_loaded_file_resolves_beside_it_not_under_its_stem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901
force-pushed
the
fix/collector-round30
branch
from
November 19, 2026 15:18
997051c to
72fbf32
Compare
This branch has not been deployed
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.
Summary
Fixes the round-30 macrorest-1 collector findings (R30-M1, R30-L1, R30-L2) and the
#[path]child-directory assumption they depended on.moddeclarations (#[cfg(unix)] mod m;beside#[cfg(not(unix))] mod m;) were ANDed by the generator into an always-false predicate, so the route was never mounted on the slow path. They are now ORed into oneany(all(..), all(..)). An ungated declaration among the twins loads the module in every build and gates nothing.#[path]module loads only its target in every build. Its test-gated child is now test-only; the walk follows the target's ownmoddeclarations instead of a directory prefix.modand#[path]declarations are recorded for every declaring file, not only files with cfg and test text. A declaration counts only when its declaring file is itself loaded in every build, so an ungatedmodinside a test-only file no longer makes its child production.#[path]directory rule (checked with rustc): children of a#[path]file load beside that file, e.g.#[path = "beside/support.rs"]withmod child;resolves tobeside/child.rs, notbeside/support/child.rs. Only amod.rstarget's children sit in its directory (both forms verified with a scratch crate). The oldchild_dirassumption is removed.The new walk is in
crates/vespera_macro/src/collector/test_scope/path_tree.rs(sidecar, keepstest_scope.rsunder the 1000-line cap).Test plan
cargo test -p vespera_macro(5893 lib tests + integration + trybuild)cargo test -p vespera(all targets)cargo clippy -p vespera_macro --all-targets -- -D warningsany(...)predicate), R30-L1, R30-L2, the beside-layout cases, and the declarer-gating cases🤖 Generated with Claude Code