File tree 1 file changed +2
-1
lines changed
rust/ql/lib/codeql/rust/elements/internal
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,11 @@ module Impl {
75
75
* pattern.
76
76
*/
77
77
private predicate variableDecl ( AstNode definingNode , Name name , string text ) {
78
- text = name .getText ( ) and
79
78
(
80
79
exists ( SelfParam sp |
81
80
name = sp .getName ( ) and
82
81
definingNode = name and
82
+ text = name .getText ( ) and
83
83
// exclude self parameters from functions without a body as these are
84
84
// trait method declarations without implementations
85
85
not exists ( Function f | not f .hasBody ( ) and f .getParamList ( ) .getSelfParam ( ) = sp )
@@ -92,6 +92,7 @@ module Impl {
92
92
or
93
93
not exists ( getOutermostEnclosingOrPat ( pat ) ) and definingNode = name
94
94
) and
95
+ text = name .getText ( ) and
95
96
// exclude for now anything starting with an uppercase character, which may be a reference to
96
97
// an enum constant (e.g. `None`). This excludes static and constant variables (UPPERCASE),
97
98
// which we don't appear to recognize yet anyway. This also assumes programmers follow the
You can’t perform that action at this time.
0 commit comments