Skip to main content

Module isolation

Module isolation 

Source
Expand description

Rust unit-isolation lint: an inline #[cfg(test)] mod may call and import only into the unit under test, its parent module reached via super::. The AST walk is the deterministic syn heuristic; its design and precision limits live in internals/rust/isolation.md.

Re-exports§

pub use crate::violation::Violation;

Enums§

Language
The unit lint language selector.

Functions§

find_integration_violations
Every no-first-party-double violation in the tests/ crates under crate root root. An integration test runs first-party code for real, so doubling it is the error; doubling an external crate is fine.
find_violations
Every isolation violation in the unit source under crate root root, sorted by (file, line). root’s Cargo.toml names the external crates. tests/, benches/, examples/, and target/ are not unit source, so a local build changes no result.