Skip to main content

evaluate

Function evaluate 

Source
pub fn evaluate(
    rule: &Rule,
    kind: CrossFileKind,
    index: &SymbolIndex,
    filter: &DeclFilter,
) -> Vec<Finding>
Expand description

Evaluate one cross-file rule against the project index.

single_impl_trait fires for a trait with exactly one declaration, exactly one concrete impl and no blanket impl. Zero impls stays silent: the trait is probably implemented outside this crate. Two or more is a legitimate abstraction. A blanket impl covers a whole family of types, so it is never an over-abstraction. A name declared twice is ambiguous and abstains. An impl for a type that is not a struct, enum or union of the trait’s own crate is an extension trait (impl VersionExt for semver::Version, or a type from a sibling workspace crate): Rust only allows inherent methods in the type’s crate, so the trait is the only way to add them and stays silent.

assertion_free_test is documented on [assertion::evaluate].

The returned order follows HashMap iteration and is not stable; the caller (normalize_findings) sorts and dedups before the result is reported.