Rust: Fix common FPs for rust/unused-variable and rust/unused-value.

This commit is contained in:
Geoffrey White
2025-12-10 15:55:28 +00:00
parent 4a1abc7beb
commit c160a1f658

View File

@@ -43,4 +43,8 @@ predicate isAllowableUnused(Variable v) {
or or
// a 'self' variable // a 'self' variable
v.getText() = "self" v.getText() = "self"
or
// a common source of false positives is match arms that are misrecognized as
// a variable, having not been correctly resolved
v.getPat().getParentNode() instanceof MatchArm
} }