You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fa50d31
Browse filesBrowse the repository at this point in the historyBrowse files
fix(rust): paths that climb out of a crate in code depend on every crate
Review on #92: a test that reads another crate's files only counted as
depending on it when the code held a literal path to that crate. Tests
that check every crate's files usually build the path instead, through
.parent(), .ancestors(), PathBuf::pop or a formatted '..' path, so a
change to the other crate skipped them.
Treat such code like code that runs Cargo: its crate depends on every
workspace crate. It only fires where the file also works with paths, so
tree parent() methods and Vec::pop keep narrowing. Crate-local paths
built from CARGO_MANIFEST_DIR stay narrow; the literal pass resolves them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityankale190895 <[email protected]>
Cargo package ownership and crate dependencies are not registered for selection yet. Command synthesis and integration remain separate milestones in [#62](https://github.com/DiffCI/core/issues/62). Metadata unions all features and target-platform dependencies, including dev-dependencies. Feature-conditional source stays crate-granular; required-feature test targets retain full validation. Locked registry and Git dependencies, including their build scripts and procedural macros, do not block selection: a `Cargo.lock` change keeps the full suite. A workspace crate with a build script, or code that runs Cargo or rustc, is treated as depending on every workspace crate, so it runs for any Rust change while other crates still narrow. A literal path in Rust code that reaches another crate becomes a dependency on that crate. When dependency declarations request features, Cargo resolves features for each tested crate alone and with its dependents (`cargo tree`), and a selected command must give every package the features the full `cargo test` gives it.
632
+
Cargo package ownership and crate dependencies are not registered for selection yet. Command synthesis and integration remain separate milestones in [#62](https://github.com/DiffCI/core/issues/62). Metadata unions all features and target-platform dependencies, including dev-dependencies. Feature-conditional source stays crate-granular; required-feature test targets retain full validation. Locked registry and Git dependencies, including their build scripts and procedural macros, do not block selection: a `Cargo.lock` change keeps the full suite. A workspace crate with a build script, code that runs Cargo or rustc, or code that climbs out of its crate directory (`.parent()`, `.ancestors()`, `PathBuf::pop` or a formatted `..` path) is treated as depending on every workspace crate, so it runs for any Rust change while other crates still narrow. A literal path in Rust code that reaches another crate becomes a dependency on that crate. When dependency declarations request features, Cargo resolves features for each tested crate alone and with its dependents (`cargo tree`), and a selected command must give every package the features the full `cargo test` gives it.
// Paths built in code that climb out of the crate can reach any crate without a literal naming it
286
+
// (review on #92): they depend on every workspace crate, like code that runs Cargo.
287
+
for(constsourceof[
288
+
'use std::path::Path; fn scan() { let p = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().join("other").join("src").join("lib.rs"); std::fs::read_to_string(p).unwrap(); }',
289
+
'use std::path::Path; fn scan() { let p = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().join("other/src/lib.rs"); std::fs::read_to_string(p).unwrap(); }',
290
+
'use std::path::Path; fn scan() { let root = Path::new(env!("CARGO_MANIFEST_DIR")).ancestors().nth(1).unwrap(); for entry in std::fs::read_dir(root).unwrap() { let _ = entry; } }',
0 commit comments