We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93836a5 commit 1a5d2e1Copy full SHA for 1a5d2e1
rust/ql/src/queries/unusedentities/UnusedVariable.qll
@@ -11,7 +11,7 @@ class DiscardVariable extends Variable {
11
* Holds if variable `v` is unused.
12
*/
13
predicate isUnused(Variable v) {
14
- // variable is accessed or initialized
+ // variable is not accessed or initialized
15
not exists(v.getAnAccess()) and
16
not exists(v.getInitializer())
17
}
@@ -22,7 +22,8 @@ predicate isUnused(Variable v) {
22
23
predicate isAllowableUnused(Variable v) {
24
// in a macro expansion
25
- v.getPat().isInMacroExpansion() or
+ v.getPat().isInMacroExpansion()
26
+ or
27
// function pointer parameters
28
exists(FnPtrType fp | fp.getParamList().getParam(_).getPat() = v.getPat())
29
0 commit comments