mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Rust: Fix common FPs for rust/unused-variable and rust/unused-value.
This commit is contained in:
@@ -43,4 +43,8 @@ predicate isAllowableUnused(Variable v) {
|
||||
or
|
||||
// a 'self' variable
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user