gccrs
gccrs copied to clipboard
Implement unused assignments lints on HIR
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)