Update rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll

Co-authored-by: Simon Friis Vindum <paldepind@github.com>
This commit is contained in:
Geoffrey White
2024-11-06 19:00:10 +00:00
committed by GitHub
parent 8a35e151d1
commit 18ce8be302

View File

@@ -88,7 +88,7 @@ module Impl {
// exclude parameters from functions without a body as these are trait method declarations
// without implementations
not exists(Function f | not f.hasBody() and f.getParamList().getAParam().getPat() = p) and
// exclude parameters from function pointers as well, which also lack a body
// exclude parameters from function pointer types (e.g. `x` in `fn(x: i32) -> i32`)
not exists(FnPtrType fp | fp.getParamList().getParam(_).getPat() = p)
}