File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
lib/codeql/rust/elements/internal
src/queries/unusedentities Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,9 @@ module Impl {
8787 not name .charAt ( 0 ) .isUppercase ( ) and
8888 // exclude parameters from functions without a body as these are trait method declarations
8989 // without implementations
90- not exists ( Function f | not f .hasBody ( ) and f .getParamList ( ) .getAParam ( ) .getPat ( ) = p )
90+ not exists ( Function f | not f .hasBody ( ) and f .getParamList ( ) .getAParam ( ) .getPat ( ) = p ) and
91+ // exclude parameters from function pointers as well, which also lack a body
92+ not exists ( FnPtrType fp | fp .getParamList ( ) .getParam ( _) .getPat ( ) = p )
9193 }
9294
9395 /** A variable. */
Original file line number Diff line number Diff line change @@ -23,7 +23,4 @@ predicate isUnused(Variable v) {
2323predicate isAllowableUnused ( Variable v ) {
2424 // in a macro expansion
2525 v .getPat ( ) .isInMacroExpansion ( )
26- or
27- // function pointer parameters
28- exists ( FnPtrType fp | fp .getParamList ( ) .getParam ( _) .getPat ( ) = v .getPat ( ) )
2926}
You can’t perform that action at this time.
0 commit comments