Labels: bug, checks-crate
Crate: checks
Description
crates/checks/src/annotations.rs's run (lines ~24-77) collects #[contract] structs and #[contractimpl] blocks by iterating file.items directly, with no Item::Mod handling at all — unlike crate::util::contractimpl_functions_excluding_test (and its sibling), which every other check in the crate uses and which recurses into nested modules.
A #[contract] struct and its #[contractimpl] block declared inside a submodule (a common organizational pattern) are completely invisible to this check:
mod contract {
#[contract]
pub struct C;
#[contractimpl]
impl C { /* ... */ }
}
A real copy-paste mismatch (missing annotation, mismatched struct name, etc.) inside a module is never reported.
Acceptance Criteria
Difficulty: intermediate
Labels: bug, checks-crate
Crate: checks
Description
crates/checks/src/annotations.rs'srun(lines ~24-77) collects#[contract]structs and#[contractimpl]blocks by iteratingfile.itemsdirectly, with noItem::Modhandling at all — unlikecrate::util::contractimpl_functions_excluding_test(and its sibling), which every other check in the crate uses and which recurses into nested modules.A
#[contract]struct and its#[contractimpl]block declared inside a submodule (a common organizational pattern) are completely invisible to this check:A real copy-paste mismatch (missing annotation, mismatched struct name, etc.) inside a module is never reported.
Acceptance Criteria
Item::Modwhen collecting both#[contract]structs and#[contractimpl]blocks, consistent with the module-aware traversal used elsewhere in the crate.Difficulty: intermediate