gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Implement unused assignments lints on HIR

Open lucasly-ba opened this issue 1 month ago • 0 comments

Fixes Rust-GCC#4260 on top of PR #4283 Used the HIR default visitor for AssignExpr, added a map, to have all the unused assignments and attached some methods to it. Since

a = 5

is an HIR::PathInExpression we cannot visit the left expr of an assignment, because it would be considerered used. So I also added a walk_right to only visit the right expr. ( if we have a = b, we want to visit b)

lucasly-ba avatar Nov 13 '25 17:11 lucasly-ba