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 {
87
87
not name .charAt ( 0 ) .isUppercase ( ) and
88
88
// exclude parameters from functions without a body as these are trait method declarations
89
89
// 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 )
91
93
}
92
94
93
95
/** A variable. */
Original file line number Diff line number Diff line change @@ -23,7 +23,4 @@ predicate isUnused(Variable v) {
23
23
predicate isAllowableUnused ( Variable v ) {
24
24
// in a macro expansion
25
25
v .getPat ( ) .isInMacroExpansion ( )
26
- or
27
- // function pointer parameters
28
- exists ( FnPtrType fp | fp .getParamList ( ) .getParam ( _) .getPat ( ) = v .getPat ( ) )
29
26
}
You can’t perform that action at this time.
0 commit comments