mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +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
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user