Skip to main content

find_violations

Function find_violations 

Source
pub fn find_violations(root: impl AsRef<Path>) -> Result<Vec<Violation>>
Expand description

Scan the Rust source files under root and return every isolation violation, sorted by (file, line) for deterministic output.

root is the crate root: its Cargo.toml names the external crates whose calls are out-of-module. The scan reuses the colocated-test unit-source walk, so it reads only the crate’s own unit source (src/, lib.rs, main.rs) and skips the non-unit trees — tests/ integration crates, benches/, examples/, and the target/ build directory — exactly as the presence rule does. A locally-built crate is therefore scanned the same as a fresh checkout: a target/ build artifact or a broken fixture under tests/ neither aborts the rule nor is false-flagged.